Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 May 2016 01:45:15 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r300385 - head/lib/libc/rpc
Message-ID:  <201605220145.u4M1jFaS074850@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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++) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605220145.u4M1jFaS074850>