From 6e0527913c6724fa92e2135de991e27df54c4289 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Mon, 20 Feb 2006 02:14:00 +0000 Subject: - Memory cleanups, found with valgrind. - Fix handling of special targets like .SUFFIX for VMS insensitive targets. - Don't make temporary batch files for -n. Make sure batch files are created in text mode. --- commands.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'commands.c') diff --git a/commands.c b/commands.c index 691eb35..a0a7c5c 100644 --- a/commands.c +++ b/commands.c @@ -157,7 +157,7 @@ set_file_variables (struct file *file) plus_len++; if (plus_len > plus_max) - plus_value = (char *) xmalloc (plus_max = plus_len); + plus_value = xrealloc (plus_value, plus_max = plus_len); cp = plus_value; qmark_len = plus_len + 1; /* Will be this or less. */ @@ -206,11 +206,11 @@ set_file_variables (struct file *file) cp = caret_value = plus_value; /* Reuse the buffer; it's big enough. */ if (qmark_len > qmark_max) - qmark_value = (char *) xmalloc (qmark_max = qmark_len); + qmark_value = xrealloc (qmark_value, qmark_max = qmark_len); qp = qmark_value; if (bar_len > bar_max) - bar_value = (char *) xmalloc (bar_max = bar_len); + bar_value = xrealloc (bar_value, bar_max = bar_len); bp = bar_value; for (d = file->deps; d != 0; d = d->next) -- cgit v1.2.3