From 48bc374a2e45d9dd97ade02d28f0ede86a093471 Mon Sep 17 00:00:00 2001 From: rillig Date: Mon, 27 Dec 2021 23:11:55 +0000 Subject: [PATCH] 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. --- usr.bin/make/main.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index b9ef31d8df00..3ed1b5a1617c 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -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