]> gcc.gnu.org Git - gcc.git/commitdiff
gensupport.c [...]: Change call to alloca to xmalloc.
authorAlan Matsuoka <alanm@redhat.com>
Thu, 15 Nov 2001 16:50:48 +0000 (16:50 +0000)
committerAlan Matsuoka <alanm@gcc.gnu.org>
Thu, 15 Nov 2001 16:50:48 +0000 (16:50 +0000)
2001-11-15  Alan Matsuoka  <alanm@redhat.com>

* gensupport.c process_include : Change call to alloca to
xmalloc.

From-SVN: r47062

gcc/ChangeLog
gcc/gensupport.c

index 3bd66d3659fd3baa07bebd61e9efc157e2820f33..fa194a23ab26002b2a429fbd8445de60d48f5f5e 100644 (file)
@@ -1,3 +1,8 @@
+2001-11-15  Alan Matsuoka  <alanm@redhat.com>
+
+       * gensupport.c  process_include : Change call to alloca to
+       xmalloc.
+
 2001-11-15  Aldy Hernandez  <aldyh@redhat.com>
 
        * config/rs6000/rs6000.md: Use spaces instead of tabs in output
index 3660378d7cf4ba3e5e87e79a2df96deddc1f4480..3bff170829537bc98185002b238a63d1ec97badc 100644 (file)
@@ -223,7 +223,7 @@ process_include (desc, lineno)
   const char *filename = XSTR (desc, 0);
   char *pathname = NULL;
   FILE *input_file;
-  char *fname;
+  char *fname = NULL;
   struct file_name_list *stackp;
   int flen;
 
@@ -257,7 +257,7 @@ process_include (desc, lineno)
 
       flen = strlen (filename);
 
-      fname = (char *) alloca (max_include_len + flen + 2);
+      fname = (char *) xmalloc (max_include_len + flen + 2);
 
       /* + 2 above for slash and terminating null.  */
 
@@ -312,6 +312,8 @@ process_include (desc, lineno)
   if (init_include_reader (input_file) == FATAL_EXIT_CODE)
     message_with_line (lineno, "read errors found in include file  %s\n", pathname);
 
+  if (fname)
+    free (fname);
   return SUCCESS_EXIT_CODE;
 }
 
This page took 0.083161 seconds and 5 git commands to generate.