aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/ztest
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2020-12-23 09:52:24 -0800
committerBrian Behlendorf <[email protected]>2021-01-05 10:31:47 -0800
commita296875da080a93aa1aef7cea0aace4f6e867cab (patch)
treee1492bc878cb5409fdc828126ee47dab485a8168 /cmd/ztest
parent921ec61b7712e60dd9ec4fc1161dc6d45d62c0e7 (diff)
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 <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matthew Ahrens <[email protected]> Closes #11396
Diffstat (limited to 'cmd/ztest')
-rw-r--r--cmd/ztest/ztest.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c
index 31205a5bf..4e1be4dd7 100644
--- a/cmd/ztest/ztest.c
+++ b/cmd/ztest/ztest.c
@@ -7016,6 +7016,7 @@ ztest_import_impl(ztest_shared_t *zs)
VERIFY0(zpool_find_config(NULL, ztest_opts.zo_pool, &cfg, &args,
&libzpool_config_ops));
VERIFY0(spa_import(ztest_opts.zo_pool, cfg, NULL, flags));
+ fnvlist_free(cfg);
}
/*