Module Name: src
Committed By: rillig
Date: Mon Dec 27 23:11:55 UTC 2021
Modified Files:
src/usr.bin/make: main.c
Log Message:
make: free the names of the makefiles in cleanup mode
Since parse.c 1.576 from 2021-12-13 the filenames from opts.makefiles no
longer end up in the GNodes, they are copied by Str_Intern.
To generate a diff of this commit:
cvs rdiff -u -r1.556 -r1.557 src/usr.bin/make/main.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/main.c
diff -u src/usr.bin/make/main.c:1.556 src/usr.bin/make/main.c:1.557
--- src/usr.bin/make/main.c:1.556 Mon Dec 27 23:06:19 2021
+++ src/usr.bin/make/main.c Mon Dec 27 23:11:55 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.556 2021/12/27 23:06:19 rillig Exp $ */
+/* $NetBSD: main.c,v 1.557 2021/12/27 23:11:55 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -111,7 +111,7 @@
#include "trace.h"
/* "@(#)main.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.556 2021/12/27 23:06:19 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.557 2021/12/27 23:11:55 rillig Exp $");
#if defined(MAKE_NATIVE) && !defined(lint)
__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
"The Regents of the University of California. "
@@ -1218,14 +1218,7 @@ ReadBuiltinRules(void)
Fatal("%s: cannot open %s.",
progname, (const char *)sysMkFiles.first->datum);
- /*
- * Free the list nodes but not the actual filenames since these may
- * still be used in GNodes.
- *
- * TODO: Check whether the above is still true after Str_Intern has
- * been added.
- */
- Lst_Done(&sysMkFiles);
+ Lst_DoneCall(&sysMkFiles, free);
}
static void
@@ -1605,7 +1598,7 @@ main_CleanUp(void)
{
#ifdef CLEANUP
Lst_DoneCall(&opts.variables, free);
- Lst_Done(&opts.makefiles);
+ Lst_DoneCall(&opts.makefiles, free);
Lst_DoneCall(&opts.create, free);
#endif