aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainer Orth <ro@TechFak.Uni-Bielefeld.DE>1999-05-07 11:09:31 +0000
committerBruce Korb <korbb@gcc.gnu.org>1999-05-07 11:09:31 +0000
commit7d032a4f633e9fc456d66a7817f3cd12fda52d68 (patch)
tree82faa2640a545bb5015b16e379b4f2f7dba0752b
parentf2fee5bef0b07099eac93e56e834b79c967ba2e9 (diff)
downloadgcc-7d032a4f633e9fc456d66a7817f3cd12fda52d68.zip
gcc-7d032a4f633e9fc456d66a7817f3cd12fda52d68.tar.gz
gcc-7d032a4f633e9fc456d66a7817f3cd12fda52d68.tar.bz2
fix memory leak in run_compiles
From-SVN: r26822
-rw-r--r--gcc/ChangeLog1
-rw-r--r--gcc/fixinc/fixincl.c17
2 files changed, 12 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index edc1e72..27aa655 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -16,6 +16,7 @@ Fri May 7 14:19:31 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
(sig_handler): Add debug code.
* fixinc/server.c (run_shell): Don't \-escape cd, it breaks the
Ultrix V4.3 /bin/sh.
+ * fixinc/fixincl.c (run_compiles): fix memory leak
Thu May 6 20:34:00 1999 Mark Mitchell <mark@codesourcery.com>
diff --git a/gcc/fixinc/fixincl.c b/gcc/fixinc/fixincl.c
index bad82b8..0b1fcb2 100644
--- a/gcc/fixinc/fixincl.c
+++ b/gcc/fixinc/fixincl.c
@@ -634,12 +634,17 @@ run_compiles ()
/* Run the script.
The result will start either with 's' or 'r'. */
- pz = run_shell (file_name_buf);
- if (*pz == 's')
- {
- p_fixd->fd_flags |= FD_SKIP_TEST;
- continue;
- }
+ {
+ int skip;
+ pz = run_shell (file_name_buf);
+ skip = (*pz == 's');
+ free ( (void*)pz );
+ if (skip)
+ {
+ p_fixd->fd_flags |= FD_SKIP_TEST;
+ continue;
+ }
+ }
}
/* FOR every test for the fixup, ... */