svn commit: r301685 - stable/9/lib/libc/rpc

Garrett Cooper ngie at FreeBSD.org
Wed Jun 8 18:43:12 UTC 2016


Author: ngie
Date: Wed Jun  8 18:43:11 2016
New Revision: 301685
URL: https://svnweb.freebsd.org/changeset/base/301685

Log:
  MFstable/10 r301682:
  
  MFC r300386:
  
  Don't leak `handle` if svc_tp_create(..) succeeds and allocating a new
  struct xlist object fails
  
  CID: 978277

Modified:
  stable/9/lib/libc/rpc/svc_generic.c
Directory Properties:
  stable/9/   (props changed)
  stable/9/lib/   (props changed)
  stable/9/lib/libc/   (props changed)

Modified: stable/9/lib/libc/rpc/svc_generic.c
==============================================================================
--- stable/9/lib/libc/rpc/svc_generic.c	Wed Jun  8 18:41:49 2016	(r301684)
+++ stable/9/lib/libc/rpc/svc_generic.c	Wed Jun  8 18:43:11 2016	(r301685)
@@ -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


More information about the svn-src-stable-9 mailing list