Module Name:    src
Committed By:   rillig
Date:           Mon Dec  7 01:24:41 UTC 2020

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

Log Message:
make(1): fix use-after-free in -DDEBUG_SRC mode (since 2020-11-22)


To generate a diff of this commit:
cvs rdiff -u -r1.327 -r1.328 src/usr.bin/make/suff.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/suff.c
diff -u src/usr.bin/make/suff.c:1.327 src/usr.bin/make/suff.c:1.328
--- src/usr.bin/make/suff.c:1.327	Sun Dec  6 10:49:02 2020
+++ src/usr.bin/make/suff.c	Mon Dec  7 01:24:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.327 2020/12/06 10:49:02 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.328 2020/12/07 01:24:41 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
 #include "dir.h"
 
 /*	"@(#)suff.c	8.4 (Berkeley) 3/21/94"	*/
-MAKE_RCSID("$NetBSD: suff.c,v 1.327 2020/12/06 10:49:02 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.328 2020/12/07 01:24:41 rillig Exp $");
 
 typedef List SuffixList;
 typedef ListNode SuffixListNode;
@@ -1089,6 +1089,7 @@ RemoveCandidate(CandidateList *srcs)
 			Lst_Done(&src->childrenList);
 #endif
 			Lst_Remove(srcs, ln);
+			free(src->file);
 			free(src);
 			return TRUE;
 		}

Reply via email to