Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): fix double free introduced this mornin...



details:   https://anonhg.NetBSD.org/src/rev/f006718d94ba
branches:  trunk
changeset: 936133:f006718d94ba
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jul 19 18:35:53 2020 +0000

description:
make(1): fix double free introduced this morning in r1.258

diffstat:

 usr.bin/make/var.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 0dc00f67d154 -r f006718d94ba usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sun Jul 19 17:43:36 2020 +0000
+++ b/usr.bin/make/var.c        Sun Jul 19 18:35:53 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.269 2020/07/19 17:43:36 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.270 2020/07/19 18:35:53 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.269 2020/07/19 17:43:36 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.270 2020/07/19 18:35:53 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c      8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.269 2020/07/19 17:43:36 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.270 2020/07/19 18:35:53 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -3042,7 +3042,7 @@
        free(else_expr);
     } else {
        st->newStr = else_expr;
-       free(else_expr);
+       free(then_expr);
     }
     if (st->v->flags & VAR_JUNK)
        st->v->flags |= VAR_KEEP;



Home | Main Index | Thread Index | Old Index