1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 01:55:10 +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) {
if (!(du = zalloc(sizeof(struct dev_use))))
if (!(du = dm_pool_zalloc(cmd->mem, sizeof(struct dev_use))))
return_0;
if (!(du->devname = strdup(strl->str))) {
free(du);
if (!(du->devname = dm_pool_strdup(cmd->mem, strl->str)))
return_0;
}
dm_list_add(&cmd->use_devices, &du->list);
}