svn commit: r294242 - stable/9/lib/libc/rpc

Garrett Cooper ngie at FreeBSD.org
Mon Jan 18 03:52:45 UTC 2016


Author: ngie
Date: Mon Jan 18 03:52:44 2016
New Revision: 294242
URL: https://svnweb.freebsd.org/changeset/base/294242

Log:
  MFstable/10 r294240:
  
  MFC r293705:
  
  Similar to r293704, fix theoretical leak of netconfig(3) resources in
  __rpcbind_is_up(..) if getnetconfig(3) is partly successful in allocating
  resources, but not completely successful by moving the endnetconfig(3) call
  up before we return from the function if nconf == NULL.
  
  Submitted by: Miles Ohlrich <miles.ohlrich at isilon.com>

Modified:
  stable/9/lib/libc/rpc/rpcb_clnt.c
Directory Properties:
  stable/9/   (props changed)
  stable/9/lib/   (props changed)
  stable/9/lib/libc/   (props changed)

Modified: stable/9/lib/libc/rpc/rpcb_clnt.c
==============================================================================
--- stable/9/lib/libc/rpc/rpcb_clnt.c	Mon Jan 18 03:51:38 2016	(r294241)
+++ stable/9/lib/libc/rpc/rpcb_clnt.c	Mon Jan 18 03:52:44 2016	(r294242)
@@ -675,11 +675,11 @@ __rpcbind_is_up()
 		    strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0)
 			 break;
 	}
+	endnetconfig(localhandle);
+
 	if (nconf == NULL)
 		return (FALSE);
 
-	endnetconfig(localhandle);
-
 	memset(&sun, 0, sizeof sun);
 	sock = _socket(AF_LOCAL, SOCK_STREAM, 0);
 	if (sock < 0)


More information about the svn-src-all mailing list