From b6722b871b141b29adb5ae46455b7d96620fa993 Mon Sep 17 00:00:00 2001 From: Matthew Ahrens Date: Wed, 23 Dec 2020 09:52:24 -0800 Subject: 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 Reviewed-by: Ryan Moeller Reviewed-by: Brian Behlendorf Signed-off-by: Matthew Ahrens Closes #11396 --- cmd/zhack/zhack.c | 1 + 1 file changed, 1 insertion(+) (limited to 'cmd/zhack/zhack.c') diff --git a/cmd/zhack/zhack.c b/cmd/zhack/zhack.c index 4d958fe43..08263120c 100644 --- a/cmd/zhack/zhack.c +++ b/cmd/zhack/zhack.c @@ -150,6 +150,7 @@ zhack_import(char *target, boolean_t readonly) zfeature_checks_disable = B_TRUE; error = spa_import(target, config, props, (readonly ? ZFS_IMPORT_SKIP_MMP : ZFS_IMPORT_NORMAL)); + fnvlist_free(config); zfeature_checks_disable = B_FALSE; if (error == EEXIST) error = 0; -- cgit v1.2.3