aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libzfs/libzfs_dataset.c
diff options
context:
space:
mode:
authorChris Williamson <[email protected]>2016-04-19 20:45:04 -0700
committerBrian Behlendorf <[email protected]>2016-05-09 11:25:41 -0700
commitb3744ae611a1920aa37b44aa3b37f02c7f23a5ba (patch)
tree7b73cb25ba34de76ce6262dc56bde84d46e98288 /lib/libzfs/libzfs_dataset.c
parent9f8026c802bf3ed23c66295ac4a0b07aa2cba528 (diff)
OpenZFS 6873 - zfs_destroy_snaps_nvl leaks errlist
Authored by: Chris Williamson <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: Paul Dagnelie <[email protected]> Ported-by: Denys Rtveliashvili <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> lzc_destroy_snaps() returns an nvlist in errlist. zfs_destroy_snaps_nvl() should nvlist_free() it before returning. OpenZFS-issue: https://www.illumos.org/issues/6873 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/ee06391 Closes #4614
Diffstat (limited to 'lib/libzfs/libzfs_dataset.c')
-rw-r--r--lib/libzfs/libzfs_dataset.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c
index 1d9e5156a..3586c0e5e 100644
--- a/lib/libzfs/libzfs_dataset.c
+++ b/lib/libzfs/libzfs_dataset.c
@@ -3447,13 +3447,15 @@ int
zfs_destroy_snaps_nvl(libzfs_handle_t *hdl, nvlist_t *snaps, boolean_t defer)
{
int ret;
- nvlist_t *errlist;
+ nvlist_t *errlist = NULL;
nvpair_t *pair;
ret = lzc_destroy_snaps(snaps, defer, &errlist);
- if (ret == 0)
+ if (ret == 0) {
+ nvlist_free(errlist);
return (0);
+ }
if (nvlist_empty(errlist)) {
char errbuf[1024];
@@ -3481,6 +3483,7 @@ zfs_destroy_snaps_nvl(libzfs_handle_t *hdl, nvlist_t *snaps, boolean_t defer)
}
}
+ nvlist_free(errlist);
return (ret);
}