From 7d032a4f633e9fc456d66a7817f3cd12fda52d68 Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Fri, 7 May 1999 11:09:31 +0000 Subject: [PATCH] fix memory leak in run_compiles From-SVN: r26822 --- gcc/ChangeLog | 1 + gcc/fixinc/fixincl.c | 17 +++++++++++------ 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 (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 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, ... */ -- 2.7.4