Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make Plug memory leak.



details:   https://anonhg.NetBSD.org/src/rev/c93be2c4162f
branches:  trunk
changeset: 823243:c93be2c4162f
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Apr 16 21:39:49 2017 +0000

description:
Plug memory leak.

CID 978372

diffstat:

 usr.bin/make/var.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 0acfe121815e -r c93be2c4162f usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sun Apr 16 21:38:38 2017 +0000
+++ b/usr.bin/make/var.c        Sun Apr 16 21:39:49 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.214 2017/04/16 19:53:58 riastradh Exp $      */
+/*     $NetBSD: var.c,v 1.215 2017/04/16 21:39:49 riastradh Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.214 2017/04/16 19:53:58 riastradh Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.215 2017/04/16 21:39:49 riastradh Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c      8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.214 2017/04/16 19:53:58 riastradh Exp $");
+__RCSID("$NetBSD: var.c,v 1.215 2017/04/16 21:39:49 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1837,8 +1837,8 @@
                 Buf_AddByte(buf, ' ');
             Buf_AddBytes(buf, (slen = strlen(s)), s);
             addSpace = (slen > 0 && s[slen - 1] != '\n');
-            free(s);
         }
+       free(s);
     }
     return addSpace;
 }



Home | Main Index | Thread Index | Old Index