From 76a3f2702ff077a9c28e95e8bbe94d499dadcfd3 Mon Sep 17 00:00:00 2001 From: delphij Date: Mon, 3 Jul 2017 02:18:10 +0000 Subject: [PATCH] MFC r320494: Fix double free by reverting r300385 and r300624 which was false positive reported by cppcheck. git-svn-id: svn://svn.freebsd.org/base/stable/9@320583 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- lib/libc/rpc/getnetconfig.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/libc/rpc/getnetconfig.c b/lib/libc/rpc/getnetconfig.c index 9220b1c59..66b9f83dc 100644 --- a/lib/libc/rpc/getnetconfig.c +++ b/lib/libc/rpc/getnetconfig.c @@ -697,7 +697,7 @@ dup_ncp(ncp) struct netconfig *ncp; { struct netconfig *p; - char *tmp, *tmp2; + char *tmp; u_int i; if ((tmp=malloc(MAXNETCONFIGLINE)) == NULL) @@ -706,7 +706,6 @@ struct netconfig *ncp; free(tmp); return(NULL); } - tmp2 = tmp; /* * First we dup all the data from matched netconfig buffer. Then we * adjust some of the member pointer to a pre-allocated buffer where @@ -728,7 +727,6 @@ struct netconfig *ncp; if (p->nc_lookups == NULL) { free(p->nc_netid); free(p); - free(tmp2); return(NULL); } for (i=0; i < p->nc_nlookups; i++) { -- 2.45.0