1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-11 09:18:25 +03:00

devicesfile: use pool memory

Switch to use command mempool instead of zalloc() as relase
part would be required otherwise.
This commit is contained in:
Zdenek Kabelac 2021-04-23 15:03:11 +02:00
parent 80ef913872
commit 2b90466f78

View File

@ -1710,13 +1710,11 @@ static int _setup_devices_list(struct cmd_context *cmd)
*/ */
dm_list_iterate_items(strl, &cmd->deviceslist) { dm_list_iterate_items(strl, &cmd->deviceslist) {
if (!(du = zalloc(sizeof(struct dev_use)))) if (!(du = dm_pool_zalloc(cmd->mem, sizeof(struct dev_use))))
return_0; return_0;
if (!(du->devname = strdup(strl->str))) { if (!(du->devname = dm_pool_strdup(cmd->mem, strl->str)))
free(du);
return_0; return_0;
}
dm_list_add(&cmd->use_devices, &du->list); dm_list_add(&cmd->use_devices, &du->list);
} }