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.
This commit is contained in:
parent
0b37d6eba5
commit
48bc374a2e
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue