Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Aug 2014 00:52:13 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r270030 - stable/10/cddl/contrib/opensolaris/lib/libdtrace/common
Message-ID:  <201408160052.s7G0qDhT009535@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Sat Aug 16 00:52:13 2014
New Revision: 270030
URL: http://svnweb.freebsd.org/changeset/base/270030

Log:
  MFC	r267875:
  
  4251 libdtrace leaks open file handles
  
  Illumos commit:		93ed8d0d4b068b95d0bb50d57bb854df462a8485
  			(partial)
  Reference:
  https://www.illumos.org/issues/4251
  
  Discussed with:	Robert Mustacchi
  Obtained from:	Illumos

Modified:
  stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c
==============================================================================
--- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c	Fri Aug 15 22:36:41 2014	(r270029)
+++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c	Sat Aug 16 00:52:13 2014	(r270030)
@@ -2289,12 +2289,15 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, cons
 			dt_dprintf("skipping library %s, already processed "
 			    "library with the same name: %s", dp->d_name,
 			    dld->dtld_library);
+			(void) fclose(fp);
 			continue;
 		}
 
 		dtp->dt_filetag = fname;
-		if (dt_lib_depend_add(dtp, &dtp->dt_lib_dep, fname) != 0)
+		if (dt_lib_depend_add(dtp, &dtp->dt_lib_dep, fname) != 0) {
+			(void) fclose(fp);
 			return (-1); /* preserve dt_errno */
+		}
 
 		rv = dt_compile(dtp, DT_CTX_DPROG,
 		    DTRACE_PROBESPEC_NAME, NULL,
@@ -2302,8 +2305,10 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, cons
 
 		if (rv != NULL && dtp->dt_errno &&
 		    (dtp->dt_errno != EDT_COMPILER ||
-		    dtp->dt_errtag != dt_errtag(D_PRAGMA_DEPEND)))
+		    dtp->dt_errtag != dt_errtag(D_PRAGMA_DEPEND))) {
+			(void) fclose(fp);
 			return (-1); /* preserve dt_errno */
+		}
 
 		if (dtp->dt_errno)
 			dt_dprintf("error parsing library %s: %s\n",



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