Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make Don't free v until after the last use.



details:   https://anonhg.NetBSD.org/src/rev/9e8f85f659e6
branches:  trunk
changeset: 487621:9e8f85f659e6
user:      sjg <sjg%NetBSD.org@localhost>
date:      Sat Jun 10 04:17:58 2000 +0000

description:
Don't free v until after the last use.

diffstat:

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

diffs (42 lines):

diff -r f187cb1471fc -r 9e8f85f659e6 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sat Jun 10 04:15:59 2000 +0000
+++ b/usr.bin/make/var.c        Sat Jun 10 04:17:58 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.50 2000/06/06 09:00:49 mycroft Exp $ */
+/*     $NetBSD: var.c,v 1.51 2000/06/10 04:17:58 sjg Exp $     */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -39,14 +39,14 @@
  */
 
 #ifdef MAKE_BOOTSTRAP
-static char rcsid[] = "$NetBSD: var.c,v 1.50 2000/06/06 09:00:49 mycroft Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.51 2000/06/10 04:17:58 sjg 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.50 2000/06/06 09:00:49 mycroft Exp $");
+__RCSID("$NetBSD: var.c,v 1.51 2000/06/10 04:17:58 sjg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2546,7 +2546,6 @@
            *freePtr = FALSE;
        }
        Buf_Destroy(v->val, TRUE);
-       free((Address)v);
        if (!(v->flags & VAR_KEEP)) {
            if (dynamic) {
                str = emalloc(*lengthPtr + 1);
@@ -2557,6 +2556,7 @@
                str = var_Error;
            }
        }
+       free((Address)v);
     }
     return (str);
 



Home | Main Index | Thread Index | Old Index