diff options
author | ngie <ngie@FreeBSD.org> | 2016-01-18 03:47:46 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2016-01-18 03:47:46 +0000 |
commit | 2e97bc7968d26612ada09a355c97b09c7c647a3f (patch) | |
tree | 89bf000940387c3a1dee4aa79c8b0d41aac57bdf /lib/libc/rpc | |
parent | d2bb6d5d236d89724b5a8d96ba88262d5e2df991 (diff) | |
download | FreeBSD-src-2e97bc7968d26612ada09a355c97b09c7c647a3f.zip FreeBSD-src-2e97bc7968d26612ada09a355c97b09c7c647a3f.tar.gz |
MFC r293704:
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.
Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>
Diffstat (limited to 'lib/libc/rpc')
-rw-r--r-- | lib/libc/rpc/rpc_soc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/rpc/rpc_soc.c b/lib/libc/rpc/rpc_soc.c index 8d0f34e..ff7a289 100644 --- a/lib/libc/rpc/rpc_soc.c +++ b/lib/libc/rpc/rpc_soc.c @@ -525,7 +525,7 @@ svcunix_create(sock, sendsize, recvsize, path) break; } if (nconf == NULL) - return(xprt); + goto done; if ((sock = __rpc_nconf2fd(nconf)) < 0) goto done; |