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): document memory handling in ApplyModif...



details:   https://anonhg.NetBSD.org/src/rev/073068a3b2bd
branches:  trunk
changeset: 948185:073068a3b2bd
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Dec 20 11:38:51 2020 +0000

description:
make(1): document memory handling in ApplyModifiers

diffstat:

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

diffs (28 lines):

diff -r bfd821e483eb -r 073068a3b2bd usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sun Dec 20 11:11:34 2020 +0000
+++ b/usr.bin/make/var.c        Sun Dec 20 11:38:51 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.740 2020/12/20 10:59:21 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.741 2020/12/20 11:38:51 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.740 2020/12/20 10:59:21 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.741 2020/12/20 11:38:51 rillig Exp $");
 
 /* A string that may need to be freed after use. */
 typedef struct FStr {
@@ -3596,7 +3596,8 @@
 
                if (st.newVal != st.val) {
                        if (*inout_freeIt != NULL) {
-                               free(st.val);
+                               assert(*inout_freeIt == st.val);
+                               free(*inout_freeIt);
                                *inout_freeIt = NULL;
                        }
                        st.val = st.newVal;



Home | Main Index | Thread Index | Old Index