From a1c5578ce0ffaa5baaa22177cafea36aa8145d8d Mon Sep 17 00:00:00 2001 From: Pavel Snajdr Date: Mon, 7 Sep 2020 17:27:51 +0200 Subject: [PATCH] dmu_redact_snap: fix possible memleak Reviewed-by: Ryan Moeller Reviewed-by: Brian Behlendorf Signed-off-by: Pavel Snajdr Closes #10879 --- module/zfs/dmu_redact.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/zfs/dmu_redact.c b/module/zfs/dmu_redact.c index b091df9257..c53fba75cc 100644 --- a/module/zfs/dmu_redact.c +++ b/module/zfs/dmu_redact.c @@ -1078,6 +1078,8 @@ dmu_redact_snap(const char *snapname, nvlist_t *redactnvl, dsl_pool_rele(dp, FTAG); kmem_free(newredactbook, sizeof (char) * ZFS_MAX_DATASET_NAME_LEN); + if (args != NULL) + kmem_free(args, numsnaps * sizeof (*args)); return (SET_ERROR(ENAMETOOLONG)); } err = dsl_bookmark_lookup(dp, newredactbook, NULL, &bookmark);