From 8ce0af07bb3227c152d32e74683d1fdc1869246c Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Thu, 15 Aug 2013 22:33:42 -0400 Subject: Illumos #4061 4061 libzfs: memory leak in iter_dependents_cb() Reviewed by: Jeffry Molanus Reviewed by: Boris Protopopov Reviewed by: Andy Stormont Reviewed by: Matthew Ahrens Approved by: Dan McDonald References: https://www.illumos.org/issues/4061 illumos/illumos-gate@2fbdf8dbf01ec1c85fcd3827cdf9e9f5f46c4c8a Ported-by: Richard Yao Signed-off-by: Brian Behlendorf Issue #1775 --- lib/libzfs/libzfs_iter.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/libzfs/libzfs_iter.c') 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 @@ -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); } -- cgit v1.2.3