Fix memory leaks in pool properties handling

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Richard Kojedzinszky <richard@kojedz.in>
Closes #17208
This commit is contained in:
Richard Kojedzinszky 2025-04-06 01:40:55 +02:00 committed by GitHub
parent 78a7c78bdf
commit 09fc7bb47e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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) &&