Date: Wed, 8 Jun 2016 18:27:45 +0000 (UTC) From: Garrett Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301682 - stable/10/lib/libc/rpc Message-ID: <201606081827.u58IRjlt053639@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Wed Jun 8 18:27:44 2016 New Revision: 301682 URL: https://svnweb.freebsd.org/changeset/base/301682 Log: MFC r300386: Don't leak `handle` if svc_tp_create(..) succeeds and allocating a new struct xlist object fails CID: 978277 Modified: stable/10/lib/libc/rpc/svc_generic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/svc_generic.c ============================================================================== --- stable/10/lib/libc/rpc/svc_generic.c Wed Jun 8 18:23:33 2016 (r301681) +++ stable/10/lib/libc/rpc/svc_generic.c Wed Jun 8 18:27:44 2016 (r301682) @@ -121,7 +121,8 @@ svc_create(dispatch, prognum, versnum, n 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, n } mutex_unlock(&xprtlist_lock); } +done: __rpc_endconf(handle); /* * In case of num == 0; the error messages are generated by the
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606081827.u58IRjlt053639>