summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpcbind/check_bound.c
diff options
context:
space:
mode:
authorasomers <asomers@FreeBSD.org>2016-01-13 17:33:50 +0000
committerasomers <asomers@FreeBSD.org>2016-01-13 17:33:50 +0000
commit5d4b291b54581036d0b7ce5996d985169913c999 (patch)
treebf5f9064be42b655d2a414e27f7975627fc7da36 /usr.sbin/rpcbind/check_bound.c
parent8298ebeec0910da6d4fb708e762ffc9738a4df64 (diff)
downloadFreeBSD-src-5d4b291b54581036d0b7ce5996d985169913c999.zip
FreeBSD-src-5d4b291b54581036d0b7ce5996d985169913c999.tar.gz
Fix Coverity warnings regarding r293229
rpcbind/check_bound.c Fix CID1347798, a memory leak in mergeaddr. rpcbind/tests/addrmerge_test.c Fix CID1347800 through CID1347803, memory leaks in ATF tests. They are harmless because each ATF test case runs in its own process, but they are trivial to fix. Fix a few other leaks that Coverity didn't detect, too. Coverity CID: 1347798, 1347800, 1347801, 1347802, 1347803 MFC after: 2 weeks X-MFC-With: 293229 Sponsored by: Spectra Logic Corp
Diffstat (limited to 'usr.sbin/rpcbind/check_bound.c')
-rw-r--r--usr.sbin/rpcbind/check_bound.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/rpcbind/check_bound.c b/usr.sbin/rpcbind/check_bound.c
index 64b73c7..23c38bc 100644
--- a/usr.sbin/rpcbind/check_bound.c
+++ b/usr.sbin/rpcbind/check_bound.c
@@ -184,18 +184,19 @@ mergeaddr(SVCXPRT *xprt, char *netid, char *uaddr, char *saddr)
dg_data = (struct svc_dg_data*)xprt->xp_p2;
if (dg_data != NULL && dg_data->su_srcaddr.buf != NULL) {
c_uaddr = taddr2uaddr(fdl->nconf, &dg_data->su_srcaddr);
+ allocated_uaddr = c_uaddr;
}
else if (saddr != NULL) {
c_uaddr = saddr;
} else {
c_uaddr = taddr2uaddr(fdl->nconf, svc_getrpccaller(xprt));
- if (c_uaddr == NULL) {
- syslog(LOG_ERR, "taddr2uaddr failed for %s",
- fdl->nconf->nc_netid);
- return (NULL);
- }
allocated_uaddr = c_uaddr;
}
+ if (c_uaddr == NULL) {
+ syslog(LOG_ERR, "taddr2uaddr failed for %s",
+ fdl->nconf->nc_netid);
+ return (NULL);
+ }
#ifdef ND_DEBUG
if (debugging) {
OpenPOWER on IntegriCloud