This is the mail archive of the
lvm2-cvs@sourceware.org
mailing list for the LVM2 project.
LVM2/libdm/ioctl libdm-iface.c
- From: zkabelac at sourceware dot org
- To: lvm-devel at redhat dot com, lvm2-cvs at sourceware dot org
- Date: 17 Oct 2011 14:36:07 -0000
- Subject: LVM2/libdm/ioctl libdm-iface.c
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac@sourceware.org 2011-10-17 14:36:06
Modified files:
libdm/ioctl : libdm-iface.c
Log message:
Use zalloc for malloc,memset
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/ioctl/libdm-iface.c.diff?cvsroot=lvm2&r1=1.123&r2=1.124
--- LVM2/libdm/ioctl/libdm-iface.c 2011/09/23 17:16:28 1.123
+++ LVM2/libdm/ioctl/libdm-iface.c 2011/10/17 14:36:06 1.124
@@ -852,7 +852,7 @@
struct target *create_target(uint64_t start, uint64_t len, const char *type,
const char *params)
{
- struct target *t = dm_malloc(sizeof(*t));
+ struct target *t = dm_zalloc(sizeof(*t));
if (!t) {
log_error("create_target: malloc(%" PRIsize_t ") failed",
@@ -860,8 +860,6 @@
return NULL;
}
- memset(t, 0, sizeof(*t));
-
if (!(t->params = dm_strdup(params))) {
log_error("create_target: strdup(params) failed");
goto bad;