summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2016-01-18 03:49:57 +0000
committerngie <ngie@FreeBSD.org>2016-01-18 03:49:57 +0000
commit6391e7176199f2b99c1f8d3e9d1a218b254a5fc6 (patch)
treedfc4ad3685797c6a7a9a7cd0230e189f36333a4e /lib
parent2e97bc7968d26612ada09a355c97b09c7c647a3f (diff)
downloadFreeBSD-src-6391e7176199f2b99c1f8d3e9d1a218b254a5fc6.zip
FreeBSD-src-6391e7176199f2b99c1f8d3e9d1a218b254a5fc6.tar.gz
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@isilon.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/rpc/rpcb_clnt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/rpc/rpcb_clnt.c b/lib/libc/rpc/rpcb_clnt.c
index 943d7c8..117ee0f 100644
--- a/lib/libc/rpc/rpcb_clnt.c
+++ b/lib/libc/rpc/rpcb_clnt.c
@@ -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)
OpenPOWER on IntegriCloud