mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
nvlist leaked in zpool_find_config()
In `zpool_find_config()`, the `pools` nvlist is leaked. Part of it (a sub-nvlist) is returned in `*configp`, but the callers also leak that. Additionally, in `zdb.c:main()`, the `searchdirs` is leaked. The leaks were detected by ASAN (`configure --enable-asan`). This commit resolves the leaks. Reviewed-by: Igor Kozhukhov <igor@dilos.org> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Matthew Ahrens <mahrens@delphix.com> Closes #11396
This commit is contained in:
committed by
Brian Behlendorf
parent
921ec61b77
commit
a296875da0
@@ -8429,6 +8429,11 @@ main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (searchdirs != NULL) {
|
||||
umem_free(searchdirs, nsearch * sizeof (char *));
|
||||
searchdirs = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* import_checkpointed_state makes the assumption that the
|
||||
* target pool that we pass it is already part of the spa
|
||||
@@ -8447,6 +8452,11 @@ main(int argc, char **argv)
|
||||
target = checkpoint_target;
|
||||
}
|
||||
|
||||
if (cfg != NULL) {
|
||||
nvlist_free(cfg);
|
||||
cfg = NULL;
|
||||
}
|
||||
|
||||
if (target_pool != target)
|
||||
free(target_pool);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user