1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cov: memleak on error path

This commit is contained in:
Zdenek Kabelac 2021-03-09 15:38:54 +01:00
parent 241c63f7a7
commit a6075fe2f2

View File

@ -1713,8 +1713,10 @@ static int _setup_devices_list(struct cmd_context *cmd)
if (!(du = zalloc(sizeof(struct dev_use)))) if (!(du = zalloc(sizeof(struct dev_use))))
return_0; return_0;
if (!(du->devname = strdup(strl->str))) if (!(du->devname = strdup(strl->str))) {
free(du);
return_0; return_0;
}
dm_list_add(&cmd->use_devices, &du->list); dm_list_add(&cmd->use_devices, &du->list);
} }