Author: ngie
Date: Mon Jan 11 22:01:33 2016
New Revision: 293705
URL: https://svnweb.freebsd.org/changeset/base/293705

Log:
  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.
  
  MFC after: 1 week
  Reported by: Coverity
  Submitted by: Miles Ohlrich <miles.ohlr...@isilon.com>
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/lib/libc/rpc/rpcb_clnt.c

Modified: head/lib/libc/rpc/rpcb_clnt.c
==============================================================================
--- head/lib/libc/rpc/rpcb_clnt.c       Mon Jan 11 21:56:53 2016        
(r293704)
+++ head/lib/libc/rpc/rpcb_clnt.c       Mon Jan 11 22:01:33 2016        
(r293705)
@@ -661,11 +661,11 @@ __rpcbind_is_up(void)
                    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-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to