Author: ngie
Date: Mon Jan 18 03:49:57 2016
New Revision: 294240
URL: https://svnweb.freebsd.org/changeset/base/294240

Log:
  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.ohlr...@isilon.com>

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

Modified: stable/10/lib/libc/rpc/rpcb_clnt.c
==============================================================================
--- stable/10/lib/libc/rpc/rpcb_clnt.c  Mon Jan 18 03:47:46 2016        
(r294239)
+++ stable/10/lib/libc/rpc/rpcb_clnt.c  Mon Jan 18 03:49:57 2016        
(r294240)
@@ -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)
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to