From 09fc7bb47e1b1ed34aa6a85d1e895f60cca193e8 Mon Sep 17 00:00:00 2001 From: Richard Kojedzinszky Date: Sun, 6 Apr 2025 01:40:55 +0200 Subject: [PATCH] Fix memory leaks in pool properties handling Reviewed-by: Alexander Motin Signed-off-by: Richard Kojedzinszky Closes #17208 --- lib/libzfs/libzfs_pool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c index 06d2c3543..320bdb55c 100644 --- a/lib/libzfs/libzfs_pool.c +++ b/lib/libzfs/libzfs_pool.c @@ -85,6 +85,7 @@ zpool_get_all_props(zpool_handle_t *zhp) fnvlist_add_string_array(innvl, ZPOOL_GET_PROPS_NAMES, zhp->zpool_propnames, zhp->zpool_n_propnames); zcmd_write_src_nvlist(hdl, &zc, innvl); + fnvlist_free(innvl); } zcmd_alloc_dst_nvlist(hdl, &zc, 0); @@ -332,7 +333,7 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, */ if (prop == ZPOOL_PROP_DEDUPCACHED) { zpool_add_propname(zhp, ZPOOL_DEDUPCACHED_PROP_NAME); - (void) zpool_get_all_props(zhp); + (void) zpool_props_refresh(zhp); } if (zhp->zpool_props == NULL && zpool_get_all_props(zhp) &&