summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2001-07-14 18:18:23 +0000
committeriedowse <iedowse@FreeBSD.org>2001-07-14 18:18:23 +0000
commitb855a121e272a07bd83ce7b51f776e73d7412cf4 (patch)
treede6ced7cd921d6d2833c26acb5d479da13a38293
parentfd51519085562e8eadceb4b8c1060bb99a78e70d (diff)
downloadFreeBSD-src-b855a121e272a07bd83ce7b51f776e73d7412cf4.zip
FreeBSD-src-b855a121e272a07bd83ce7b51f776e73d7412cf4.tar.gz
Fix a memory leak in __rpcb_findaddr(), avoid compiler warnings.
Submitted by: Martin Blapp <mb@imp.ch>
-rw-r--r--lib/libc/rpc/rpcb_clnt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc/rpc/rpcb_clnt.c b/lib/libc/rpc/rpcb_clnt.c
index 6ad34f3..d70aaec 100644
--- a/lib/libc/rpc/rpcb_clnt.c
+++ b/lib/libc/rpc/rpcb_clnt.c
@@ -298,6 +298,7 @@ getclnthandle(host, nconf, targaddr)
/* VARIABLES PROTECTED BY rpcbaddr_cache_lock: ad_cache */
/* Get the address of the rpcbind. Check cache first */
+ client = NULL;
addr_to_delete.len = 0;
rwlock_rdlock(&rpcbaddr_cache_lock);
ad_cache = check_cache(host, nconf->nc_netid);
@@ -938,6 +939,8 @@ done:
} else if (client) {
CLNT_DESTROY(client);
}
+ if (parms.r_addr != NULL && parms.r_addr != nullstring)
+ free(parms.r_addr);
return (address);
}
@@ -1056,7 +1059,7 @@ rpcb_rmtcall(nconf, host, prog, vers, proc, xdrargs, argsp,
struct r_rpcb_rmtcallres r;
rpcvers_t rpcb_vers;
-
+ stat = 0;
client = getclnthandle(host, nconf, NULL);
if (client == NULL) {
return (RPC_FAILED);
OpenPOWER on IntegriCloud