Module Name:    src
Committed By:   rillig
Date:           Tue Oct 27 07:51:43 UTC 2020

Modified Files:
        src/usr.bin/make: main.c

Log Message:
make(1): free the variable names given on the command line

These are not aliased anywhere.  The opts.makefiles on the other hand
may be referenced in GNode.fname or pretty much anywhere else, so don't
free them.  There's still a Targ_PrintGraph call below it that might use
them.


To generate a diff of this commit:
cvs rdiff -u -r1.400 -r1.401 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.400 src/usr.bin/make/main.c:1.401
--- src/usr.bin/make/main.c:1.400	Tue Oct 27 07:44:43 2020
+++ src/usr.bin/make/main.c	Tue Oct 27 07:51:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.400 2020/10/27 07:44:43 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.401 2020/10/27 07:51:43 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -118,7 +118,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.400 2020/10/27 07:44:43 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.401 2020/10/27 07:51:43 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	    "The Regents of the University of California.  "
@@ -1528,8 +1528,8 @@ main(int argc, char **argv)
 	}
 
 #ifdef CLEANUP
-	Lst_Free(opts.variables);
-	Lst_Free(opts.makefiles);
+	Lst_Destroy(opts.variables, free);
+	Lst_Free(opts.makefiles);	/* don't free, may be used in GNodes */
 	Lst_Destroy(opts.create, free);
 #endif
 

Reply via email to