Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Aug 2013 00:29:35 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254755 - head/cddl/contrib/opensolaris/lib/libzfs/common
Message-ID:  <201308240029.r7O0TZUe095311@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Sat Aug 24 00:29:34 2013
New Revision: 254755
URL: http://svnweb.freebsd.org/changeset/base/254755

Log:
  MFV r254748:
  
  Fix memory leak in libzfs's iter_dependents_cb().
  
  Illumos ZFS issues:
    4061 libzfs: memory leak in iter_dependents_cb()

Modified:
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/lib/libzfs/   (props changed)

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c	Sat Aug 24 00:26:15 2013	(r254754)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c	Sat Aug 24 00:29:34 2013	(r254755)
@@ -21,10 +21,10 @@
 
 /*
  * 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 (c) 2012 Pawel Jakub Dawidek <pawel@dawidek.net>.
  * All rights reserved.
+ * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  */
 
 #include <stdio.h>
@@ -452,8 +452,12 @@ iter_dependents_cb(zfs_handle_t *zhp, vo
 		}
 		ida->stack = isf.next;
 	}
+
 	if (!first && err == 0)
 		err = ida->func(zhp, ida->data);
+	else
+		zfs_close(zhp);
+
 	return (err);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308240029.r7O0TZUe095311>