Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Mar 2014 00:32:26 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r263408 - in stable: 8/cddl/contrib/opensolaris/lib/libzfs/common 9/cddl/contrib/opensolaris/lib/libzfs/common
Message-ID:  <201403200032.s2K0WQDY025593@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Thu Mar 20 00:32:26 2014
New Revision: 263408
URL: http://svnweb.freebsd.org/changeset/base/263408

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

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

Changes in other areas also in this revision:
Modified:
  stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c
Directory Properties:
  stable/8/cddl/contrib/opensolaris/   (props changed)
  stable/8/cddl/contrib/opensolaris/lib/libzfs/   (props changed)

Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c
==============================================================================
--- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c	Thu Mar 20 00:28:53 2014	(r263407)
+++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c	Thu Mar 20 00:32:26 2014	(r263408)
@@ -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?201403200032.s2K0WQDY025593>