mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-12 13:18:31 +03:00
Use zalloc for malloc,memset
This commit is contained in:
parent
edb7aaf046
commit
cd2eab0d10
@ -852,7 +852,7 @@ int dm_task_set_event_nr(struct dm_task *dmt, uint32_t event_nr)
|
||||
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 @@ struct target *create_target(uint64_t start, uint64_t len, const char *type,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(t, 0, sizeof(*t));
|
||||
|
||||
if (!(t->params = dm_strdup(params))) {
|
||||
log_error("create_target: strdup(params) failed");
|
||||
goto bad;
|
||||
|
Loading…
Reference in New Issue
Block a user