nvlist leaked in zpool_find_config()
authorMatthew Ahrens <mahrens@delphix.com>
Wed, 23 Dec 2020 17:52:24 +0000 (09:52 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 28 Dec 2020 18:05:31 +0000 (10:05 -0800)
commitb6722b871b141b29adb5ae46455b7d96620fa993
treed367be7860998a93ba96ea3a56c63b7b00c909a6
parent40ab927ae817b44fcb7fa043a8073c5f049f9257
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
cmd/zdb/zdb.c
cmd/zhack/zhack.c
cmd/ztest/ztest.c
lib/libzutil/zutil_import.c