summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc/svc_generic.c
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2016-05-22 02:02:18 +0000
committerngie <ngie@FreeBSD.org>2016-05-22 02:02:18 +0000
commitb7a4441f22fb1c55f706450cab439e75b7ec3e4c (patch)
tree123cf210981da4b8657654b216c815c8088a88c7 /lib/libc/rpc/svc_generic.c
parentb602243d334d76a2fa062053482291d834cb0e21 (diff)
downloadFreeBSD-src-b7a4441f22fb1c55f706450cab439e75b7ec3e4c.zip
FreeBSD-src-b7a4441f22fb1c55f706450cab439e75b7ec3e4c.tar.gz
Don't leak `handle` if svc_tp_create(..) succeeds and allocating a new
struct xlist object fails MFC after: 1 week Reported by: Coverity CID: 978277 Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'lib/libc/rpc/svc_generic.c')
-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 d3db612..00bbc5a 100644
--- a/lib/libc/rpc/svc_generic.c
+++ b/lib/libc/rpc/svc_generic.c
@@ -122,7 +122,8 @@ svc_create(void (*dispatch)(struct svc_req *, SVCXPRT *),
if (l == NULL) {
warnx("svc_create: no memory");
mutex_unlock(&xprtlist_lock);
- return (0);
+ num = 0;
+ goto done;
}
l->xprt = xprt;
l->next = xprtlist;
@@ -132,6 +133,7 @@ svc_create(void (*dispatch)(struct svc_req *, SVCXPRT *),
}
mutex_unlock(&xprtlist_lock);
}
+done:
__rpc_endconf(handle);
/*
* In case of num == 0; the error messages are generated by the
OpenPOWER on IntegriCloud