OSDN Git Service

fix memory leak in run_compiles
authorkorbb <korbb@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 7 May 1999 11:09:31 +0000 (11:09 +0000)
committerkorbb <korbb@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 7 May 1999 11:09:31 +0000 (11:09 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26822 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/fixinc/fixincl.c

index edc1e72..27aa655 100644 (file)
@@ -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>
 
index bad82b8..0b1fcb2 100644 (file)
@@ -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, ...  */