Module Name: src
Committed By: rillig
Date: Mon Dec 7 01:27:08 UTC 2020
Modified Files:
src/usr.bin/make: suff.c
Log Message:
make(1): actually fix the use-after-free bug and the double-free
The use-after-free bug had been there since 2020-11-22, the double-free
bug since a few minutes.
To generate a diff of this commit:
cvs rdiff -u -r1.328 -r1.329 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.328 src/usr.bin/make/suff.c:1.329
--- src/usr.bin/make/suff.c:1.328 Mon Dec 7 01:24:41 2020
+++ src/usr.bin/make/suff.c Mon Dec 7 01:27:08 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: suff.c,v 1.328 2020/12/07 01:24:41 rillig Exp $ */
+/* $NetBSD: suff.c,v 1.329 2020/12/07 01:27:08 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.328 2020/12/07 01:24:41 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.329 2020/12/07 01:27:08 rillig Exp $");
typedef List SuffixList;
typedef ListNode SuffixListNode;
@@ -1068,7 +1068,6 @@ RemoveCandidate(CandidateList *srcs)
Candidate *src = ln->datum;
if (src->numChildren == 0) {
- free(src->file);
if (src->parent == NULL)
free(src->prefix);
else {