1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 01:55:10 +03:00

lvmcache: fix memory leak

With commit 0b18c25d93 there
was introduced  'zalloc()' for allocation of outdates pvs,
but no matching  'free()' is present.
Switch to use cmd mempool instead of adding free() code into
several places.
This commit is contained in:
Zdenek Kabelac 2021-04-23 14:44:57 +02:00
parent 66dd481f46
commit 5e8307f4bf
2 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.03.12 -
===================================
Fix memleak when generating list of outdated pvs.
Better hyphenation usage in man pages.
Replace use of deprecated security_context_t with char*.
Configure supports AIO_LIBS and AIO_CFLAGS.

View File

@ -2818,7 +2818,7 @@ void lvmcache_get_outdated_devs(struct cmd_context *cmd,
}
dm_list_iterate_items(info, &vginfo->outdated_infos) {
if (!(devl = zalloc(sizeof(*devl))))
if (!(devl = dm_pool_zalloc(cmd->mem, sizeof(*devl))))
return;
devl->dev = info->dev;
dm_list_add(devs, &devl->list);