Module Name: src
Committed By: riastradh
Date: Sun Apr 16 21:38:38 UTC 2017
Modified Files:
src/usr.bin/make: parse.c
Log Message:
Plug memory leak in ParseTraditionalInclude.
To generate a diff of this commit:
cvs rdiff -u -r1.223 -r1.224 src/usr.bin/make/parse.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.223 src/usr.bin/make/parse.c:1.224
--- src/usr.bin/make/parse.c:1.223 Sun Apr 16 21:37:37 2017
+++ src/usr.bin/make/parse.c Sun Apr 16 21:38:38 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.223 2017/04/16 21:37:37 riastradh Exp $ */
+/* $NetBSD: parse.c,v 1.224 2017/04/16 21:38:38 riastradh Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.223 2017/04/16 21:37:37 riastradh Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.224 2017/04/16 21:38:38 riastradh Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: parse.c,v 1.223 2017/04/16 21:37:37 riastradh Exp $");
+__RCSID("$NetBSD: parse.c,v 1.224 2017/04/16 21:38:38 riastradh Exp $");
#endif
#endif /* not lint */
#endif
@@ -2546,7 +2546,7 @@ ParseTraditionalInclude(char *line)
if (*file == '\0') {
Parse_Error(PARSE_FATAL,
"Filename missing from \"include\"");
- return;
+ goto out;
}
for (file = all_files; !done; file = cp + 1) {
@@ -2561,6 +2561,7 @@ ParseTraditionalInclude(char *line)
Parse_include_file(file, FALSE, FALSE, silent);
}
+out:
free(all_files);
}
#endif