From 576b83f95f63ff7b7f844f6893b44a6a91604f28 Mon Sep 17 00:00:00 2001 From: ngie Date: Mon, 18 Jan 2016 03:51:38 +0000 Subject: [PATCH] MFstable/10 r294239: 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 git-svn-id: svn://svn.freebsd.org/base/stable/9@294241 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- lib/libc/rpc/rpc_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/rpc/rpc_soc.c b/lib/libc/rpc/rpc_soc.c index 8d0f34ec5..ff7a2897b 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; -- 2.45.0