summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorIan Dowse <iedowse@FreeBSD.org>2002-02-16 17:05:49 +0000
committerIan Dowse <iedowse@FreeBSD.org>2002-02-16 17:05:49 +0000
commit6112fceebda44924ca6cc82f2e507807d2ab4e3a (patch)
tree95350dd3cda2b2f2bb653717b047324959818b94 /lib/libc
parent8c1dde21a35bb8178593ec1ebf78d9785fd6409f (diff)
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/rpc/rpcb_clnt.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/libc/rpc/rpcb_clnt.c b/lib/libc/rpc/rpcb_clnt.c
index b75c0a9987c8..e1400cce1ddb 100644
--- a/lib/libc/rpc/rpcb_clnt.c
+++ b/lib/libc/rpc/rpcb_clnt.c
@@ -459,8 +459,14 @@ local_rpcb()
client = clnt_vc_create(sock, &nbuf, (rpcprog_t)RPCBPROG,
(rpcvers_t)RPCBVERS, tsize, tsize);
- if (client != NULL)
+ if (client != NULL) {
+ /* Mark the socket to be closed in destructor */
+ (void) CLNT_CONTROL(client, CLSET_FD_CLOSE, NULL);
return client;
+ }
+
+ /* Nobody needs this socket anymore; free the descriptor. */
+ _close(sock);
try_nconf:
@@ -552,6 +558,7 @@ rpcb_set(program, version, nconf, address)
parms.r_addr = taddr2uaddr((struct netconfig *) nconf,
(struct netbuf *)address);
if (!parms.r_addr) {
+ CLNT_DESTROY(client);
rpc_createerr.cf_stat = RPC_N2AXLATEFAILURE;
return (FALSE); /* no universal address */
}