summaryrefslogtreecommitdiffstats
path: root/cddl
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2015-01-23 18:36:21 +0000
committerdelphij <delphij@FreeBSD.org>2015-01-23 18:36:21 +0000
commit429a0a7af7eec333d5ae02fa4ae60f49a74500cd (patch)
treec8f5ba1f3180b60173b186e615d3701b2359529d /cddl
parentb84208b123f4cec533e4449564deb64491c7d2b0 (diff)
downloadFreeBSD-src-429a0a7af7eec333d5ae02fa4ae60f49a74500cd.zip
FreeBSD-src-429a0a7af7eec333d5ae02fa4ae60f49a74500cd.tar.gz
MFC r275812: MFV r275784:
Plug a memory leak in libzfs. In zfs_iter_bookmarks, an nvlist is allocated before calling lzc_get_bookmarks, which allocates the nvlist again (and overwrites the pointer to previously allocated list). Illumos issue: 5427 memory leak in libzfs when doing rollback
Diffstat (limited to 'cddl')
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c
index 9698a72..aadc1f9 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c
@@ -24,7 +24,7 @@
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright (c) 2012 Pawel Jakub Dawidek <pawel@dawidek.net>.
* All rights reserved.
- * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
*/
#include <stdio.h>
@@ -193,9 +193,6 @@ zfs_iter_bookmarks(zfs_handle_t *zhp, zfs_iter_f func, void *data)
fnvlist_add_boolean(props, zfs_prop_to_name(ZFS_PROP_CREATETXG));
fnvlist_add_boolean(props, zfs_prop_to_name(ZFS_PROP_CREATION));
- /* Allocate an nvlist to hold the bookmarks. */
- bmarks = fnvlist_alloc();
-
if ((err = lzc_get_bookmarks(zhp->zfs_name, props, &bmarks)) != 0)
goto out;
OpenPOWER on IntegriCloud