Skip to content

Commit

Permalink
6873 zfs_destroy_snaps_nvl leaks errlist
Browse files Browse the repository at this point in the history
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
  • Loading branch information
cwill authored and ahrens committed Apr 22, 2016
1 parent cec7ac1 commit 4cde22c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions usr/src/lib/libzfs/common/libzfs_dataset.c
Expand Up @@ -3403,12 +3403,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];
Expand Down Expand Up @@ -3436,6 +3438,7 @@ zfs_destroy_snaps_nvl(libzfs_handle_t *hdl, nvlist_t *snaps, boolean_t defer)
}
}

nvlist_free(errlist);
return (ret);
}

Expand Down

0 comments on commit 4cde22c

Please sign in to comment.