aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarcel Telka <[email protected]>2013-08-15 22:33:42 -0400
committerBrian Behlendorf <[email protected]>2013-11-05 12:24:10 -0800
commit8ce0af07bb3227c152d32e74683d1fdc1869246c (patch)
treeb9bdb797fa75c7c9e3473135bca94e696a4a46c3 /lib
parentb663a23d36d805dd5e9d1b4663dbf5966944002d (diff)
Illumos #4061
4061 libzfs: memory leak in iter_dependents_cb() Reviewed by: Jeffry Molanus <[email protected]> Reviewed by: Boris Protopopov <[email protected]> Reviewed by: Andy Stormont <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Approved by: Dan McDonald <[email protected]> References: https://www.illumos.org/issues/4061 illumos/illumos-gate@2fbdf8dbf01ec1c85fcd3827cdf9e9f5f46c4c8a Ported-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #1775
Diffstat (limited to 'lib')
-rw-r--r--lib/libzfs/libzfs_iter.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libzfs/libzfs_iter.c b/lib/libzfs/libzfs_iter.c
index 3d8bc5e14..e527bdcc5 100644
--- a/lib/libzfs/libzfs_iter.c
+++ b/lib/libzfs/libzfs_iter.c
@@ -21,8 +21,8 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2010 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
*/
#include <stdio.h>
@@ -449,8 +449,12 @@ iter_dependents_cb(zfs_handle_t *zhp, void *arg)
iter_dependents_cb, ida);
ida->stack = isf.next;
}
+
if (!first && err == 0)
err = ida->func(zhp, ida->data);
+ else
+ zfs_close(zhp);
+
return (err);
}