(do_include): Re-fix minor memory leak by using alloca instead of
authorRichard Kenner <kenner@gcc.gnu.org>
Sat, 29 Apr 1995 19:44:14 +0000 (15:44 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Sat, 29 Apr 1995 19:44:14 +0000 (15:44 -0400)
xmalloc and free.

From-SVN: r9544

gcc/cccp.c

index 7c49e4d..3b15d32 100644 (file)
@@ -4573,13 +4573,12 @@ get_filename:
 
                    if (searchptr->fname[0] == 0)
                      continue;
-                   p = xmalloc (strlen (searchptr->fname)
-                                + strlen (fname) + 2);
+                   p = alloca (strlen (searchptr->fname)
+                               + strlen (fname) + 2);
                    strcpy (p, searchptr->fname);
                    strcat (p, "/");
                    strcat (p, fname);
                    deps_output (p, ' ');
-                   free (p);
                    break;
                  }
              }