summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/compat.c
diff options
context:
space:
mode:
authorjkoshy <jkoshy@FreeBSD.org>1998-09-09 05:15:38 +0000
committerjkoshy <jkoshy@FreeBSD.org>1998-09-09 05:15:38 +0000
commit59069acd01a5be9ee318635a93b97f59f1847e97 (patch)
tree99528322f68eadbd449a504098dc4d63dd3e8963 /usr.bin/make/compat.c
parentfbca1bfc8514de8dd00ee251bed52a0d77c26bdd (diff)
downloadFreeBSD-src-59069acd01a5be9ee318635a93b97f59f1847e97.zip
FreeBSD-src-59069acd01a5be9ee318635a93b97f59f1847e97.tar.gz
Fix spurious `free()' when -d g2 is enabled.
PR: 6790 Submitted by: nsmart <njs3@doc.ic.ac.uk>
Diffstat (limited to 'usr.bin/make/compat.c')
-rw-r--r--usr.bin/make/compat.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c
index bff02c8..284e786 100644
--- a/usr.bin/make/compat.c
+++ b/usr.bin/make/compat.c
@@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: compat.c,v 1.10 1998/05/13 05:50:42 jb Exp $
+ * $Id: compat.c,v 1.11 1998/08/24 10:15:53 cracauer Exp $
*/
#ifndef lint
@@ -336,8 +336,17 @@ CompatRunCommand (cmdp, gnp)
}
exit(1);
}
- free(cmdStart);
- Lst_Replace (cmdNode, (ClientData) NULL);
+
+ /*
+ * we need to print out the command associated with this Gnode in
+ * Targ_PrintCmd from Targ_PrintGraph when debugging at level g2,
+ * in main(), Fatal() and DieHorribly(), therefore do not free it
+ * when debugging.
+ */
+ if (!DEBUG(GRAPH2)) {
+ free(cmdStart);
+ Lst_Replace (cmdNode, cmdp);
+ }
/*
* The child is off and running. Now all we can do is wait...
OpenPOWER on IntegriCloud