diff options
author | mav <mav@FreeBSD.org> | 2016-10-12 05:10:48 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2016-10-12 05:10:48 +0000 |
commit | 80968f056434a1fb0507c0573e005586bfc65edb (patch) | |
tree | 0d42000ae85fe3ac08df490140307bca2aa497fa /cddl/contrib | |
parent | 3fa898372d7944fa7a133e94e69a6bb2ccdecc2d (diff) | |
download | FreeBSD-src-80968f056434a1fb0507c0573e005586bfc65edb.zip FreeBSD-src-80968f056434a1fb0507c0573e005586bfc65edb.tar.gz |
MFC r305203: MFV r302655: 6873 zfs_destroy_snaps_nvl leaks errlist
illumos/illumos-gate@4cde22c29999ffb907ca39d2ebd512812f7e5168
https://github.com/illumos/illumos-gate/commit/4cde22c29999ffb907ca39d2ebd512812
f7e5168
https://www.illumos.org/issues/6873
lzc_destroy_snaps() returns an nvlist in errlist.
zfs_destroy_snaps_nvl() should nvlist_free() it before returning.
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Chris Williamson <chris.williamson@delphix.com>
Diffstat (limited to 'cddl/contrib')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c index 8021033..9dcab66 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c @@ -3455,12 +3455,14 @@ int zfs_destroy_snaps_nvl(libzfs_handle_t *hdl, nvlist_t *snaps, boolean_t defer) { int ret; - nvlist_t *errlist; + nvlist_t *errlist = NULL; 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]; @@ -3488,6 +3490,7 @@ zfs_destroy_snaps_nvl(libzfs_handle_t *hdl, nvlist_t *snaps, boolean_t defer) } } + nvlist_free(errlist); return (ret); } |