summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc/rpc_soc.c
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2016-01-11 21:56:53 +0000
committerngie <ngie@FreeBSD.org>2016-01-11 21:56:53 +0000
commitcf1ded0c14305d1beb8f684c5c2af13f5199a13e (patch)
treed23174df8bfd2e3b4b37c4a022d77a1c7df365ba /lib/libc/rpc/rpc_soc.c
parent347d22a11bbe9dc00f0479b7595ccb343215cba3 (diff)
downloadFreeBSD-src-cf1ded0c14305d1beb8f684c5c2af13f5199a13e.zip
FreeBSD-src-cf1ded0c14305d1beb8f684c5c2af13f5199a13e.tar.gz
Fix theoretical leak of netconfig(3) resources in svcunix_create(..)
In the event that the getconfig(3) call in svcunix_create is partly successful, some of the netconfig(3) resources allocated might be leaked if the call returns NULL as endnetconfig(3) wasn't called explicitly in that case. Ensure that the resources are fully cleaned up by going to the `done` label, which will call endnetconfig(3) for us. MFC after: 1 week Reported by: Coverity Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com> Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'lib/libc/rpc/rpc_soc.c')
-rw-r--r--lib/libc/rpc/rpc_soc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/rpc/rpc_soc.c b/lib/libc/rpc/rpc_soc.c
index 11fc803..64516a9 100644
--- a/lib/libc/rpc/rpc_soc.c
+++ b/lib/libc/rpc/rpc_soc.c
@@ -483,7 +483,7 @@ svcunix_create(int sock, u_int sendsize, u_int recvsize, char *path)
break;
}
if (nconf == NULL)
- return(xprt);
+ goto done;
if ((sock = __rpc_nconf2fd(nconf)) < 0)
goto done;
OpenPOWER on IntegriCloud