summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2016-06-08 18:27:44 +0000
committerngie <ngie@FreeBSD.org>2016-06-08 18:27:44 +0000
commite55bbd66610a2b3e14882d62cf6a1f102aa8498e (patch)
treed33af57fd4873f96df59e9a13c3636fd6b716223 /lib
parent493224304ce13d1cca267d1e7b62cd1cdef1ecb3 (diff)
downloadFreeBSD-src-e55bbd66610a2b3e14882d62cf6a1f102aa8498e.zip
FreeBSD-src-e55bbd66610a2b3e14882d62cf6a1f102aa8498e.tar.gz
MFC r300386:
Don't leak `handle` if svc_tp_create(..) succeeds and allocating a new struct xlist object fails CID: 978277
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/rpc/svc_generic.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/rpc/svc_generic.c b/lib/libc/rpc/svc_generic.c
index 21569c0..dca79f5 100644
--- a/lib/libc/rpc/svc_generic.c
+++ b/lib/libc/rpc/svc_generic.c
@@ -121,7 +121,8 @@ svc_create(dispatch, prognum, versnum, nettype)
if (l == NULL) {
warnx("svc_create: no memory");
mutex_unlock(&xprtlist_lock);
- return (0);
+ num = 0;
+ goto done;
}
l->xprt = xprt;
l->next = xprtlist;
@@ -131,6 +132,7 @@ svc_create(dispatch, prognum, versnum, nettype)
}
mutex_unlock(&xprtlist_lock);
}
+done:
__rpc_endconf(handle);
/*
* In case of num == 0; the error messages are generated by the
OpenPOWER on IntegriCloud