Skip to content

Commit 4cde22c

Browse files
cwillahrens
authored andcommitted
6873 zfs_destroy_snaps_nvl leaks errlist
Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Paul Dagnelie <pcd@delphix.com> Approved by: Dan McDonald <danmcd@omniti.com>
1 parent cec7ac1 commit 4cde22c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

usr/src/lib/libzfs/common/libzfs_dataset.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3403,12 +3403,14 @@ int
34033403
zfs_destroy_snaps_nvl(libzfs_handle_t *hdl, nvlist_t *snaps, boolean_t defer)
34043404
{
34053405
int ret;
3406-
nvlist_t *errlist;
3406+
nvlist_t *errlist = NULL;
34073407

34083408
ret = lzc_destroy_snaps(snaps, defer, &errlist);
34093409

3410-
if (ret == 0)
3410+
if (ret == 0) {
3411+
nvlist_free(errlist);
34113412
return (0);
3413+
}
34123414

34133415
if (nvlist_empty(errlist)) {
34143416
char errbuf[1024];
@@ -3436,6 +3438,7 @@ zfs_destroy_snaps_nvl(libzfs_handle_t *hdl, nvlist_t *snaps, boolean_t defer)
34363438
}
34373439
}
34383440

3441+
nvlist_free(errlist);
34393442
return (ret);
34403443
}
34413444

0 commit comments

Comments
 (0)