diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/rpc/rpcb_clnt.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/libc/rpc/rpcb_clnt.c b/lib/libc/rpc/rpcb_clnt.c index ac34c34..aa9d6ed 100644 --- a/lib/libc/rpc/rpcb_clnt.c +++ b/lib/libc/rpc/rpcb_clnt.c @@ -239,11 +239,21 @@ add_cache(host, netid, taddr, uaddr) ad_cache->ac_taddr = (struct netbuf *)malloc(sizeof (struct netbuf)); if (!ad_cache->ac_host || !ad_cache->ac_netid || !ad_cache->ac_taddr || (uaddr && !ad_cache->ac_uaddr)) { - return; + goto out; } ad_cache->ac_taddr->len = ad_cache->ac_taddr->maxlen = taddr->len; ad_cache->ac_taddr->buf = (char *) malloc(taddr->len); if (ad_cache->ac_taddr->buf == NULL) { +out: + if (ad_cache->ac_host) + free(ad_cache->ac_host); + if (ad_cache->ac_netid) + free(ad_cache->ac_netid); + if (ad_cache->ac_uaddr) + free(ad_cache->ac_uaddr); + if (ad_cache->ac_taddr) + free(ad_cache->ac_taddr); + free(ad_cache); return; } memcpy(ad_cache->ac_taddr->buf, taddr->buf, taddr->len); @@ -1012,11 +1022,6 @@ regular_rpcbind: } } - if ((address == NULL) || (address->len == 0)) { - rpc_createerr.cf_stat = RPC_PROGNOTREGISTERED; - clnt_geterr(client, &rpc_createerr.cf_error); - } - error: if (client) { CLNT_DESTROY(client); |