svn commit: r300385 - head/lib/libc/rpc

Garrett Cooper ngie at FreeBSD.org
Sun May 22 01:45:16 UTC 2016


Author: ngie
Date: Sun May 22 01:45:15 2016
New Revision: 300385
URL: https://svnweb.freebsd.org/changeset/base/300385

Log:
  Don't leak `tmp` if `p->nc_lookups` can't be malloced
  
  MFC after: 1 week
  Reported by: cppcheck
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/lib/libc/rpc/getnetconfig.c

Modified: head/lib/libc/rpc/getnetconfig.c
==============================================================================
--- head/lib/libc/rpc/getnetconfig.c	Sun May 22 00:29:25 2016	(r300384)
+++ head/lib/libc/rpc/getnetconfig.c	Sun May 22 01:45:15 2016	(r300385)
@@ -722,6 +722,7 @@ dup_ncp(struct netconfig *ncp)
     if (p->nc_lookups == NULL) {
 	free(p->nc_netid);
 	free(p);
+	free(tmp);
 	return(NULL);
     }
     for (i=0; i < p->nc_nlookups; i++) {


More information about the svn-src-all mailing list