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: fix memory leak in error case of the ':?'...



details:   https://anonhg.NetBSD.org/src/rev/d48b2675c40e
branches:  trunk
changeset: 987340:d48b2675c40e
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Sep 23 22:54:09 2021 +0000

description:
make: fix memory leak in error case of the ':?' modifier

diffstat:

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

diffs (27 lines):

diff -r da8eaaff6480 -r d48b2675c40e usr.bin/make/var.c
--- a/usr.bin/make/var.c        Thu Sep 23 17:51:52 2021 +0000
+++ b/usr.bin/make/var.c        Thu Sep 23 22:54:09 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.951 2021/09/21 23:06:18 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.952 2021/09/23 22:54:09 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.951 2021/09/21 23:06:18 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.952 2021/09/23 22:54:09 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -3444,6 +3444,8 @@
        if (cond_rc == COND_INVALID) {
                Error("Bad conditional expression '%s' in '%s?%s:%s'",
                    expr->name, expr->name, then_expr.str, else_expr.str);
+               FStr_Done(&then_expr);
+               FStr_Done(&else_expr);
                return AMR_CLEANUP;
        }
 



Home | Main Index | Thread Index | Old Index