From: Rainer Orth Date: Fri, 7 May 1999 11:09:31 +0000 (+0000) Subject: fix memory leak in run_compiles X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7d032a4f633e9fc456d66a7817f3cd12fda52d68;p=gcc.git fix memory leak in run_compiles From-SVN: r26822 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index edc1e721d2b..27aa6555669 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 bad82b86d8d..0b1fcb2b379 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, ... */