aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Matsuoka <alanm@redhat.com>2001-11-15 16:50:48 +0000
committerAlan Matsuoka <alanm@gcc.gnu.org>2001-11-15 16:50:48 +0000
commit94414790d6620d7ae3f513edd561f471b912c780 (patch)
tree561920af7814b557a8c9460a0adf8c0913d807fa
parent8a2b77e7376a10b62a023843a64d4998fde5b5da (diff)
downloadgcc-94414790d6620d7ae3f513edd561f471b912c780.zip
gcc-94414790d6620d7ae3f513edd561f471b912c780.tar.gz
gcc-94414790d6620d7ae3f513edd561f471b912c780.tar.bz2
gensupport.c [...]: Change call to alloca to xmalloc.
2001-11-15 Alan Matsuoka <alanm@redhat.com> * gensupport.c process_include : Change call to alloca to xmalloc. From-SVN: r47062
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/gensupport.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3bd66d3..fa194a2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/gensupport.c b/gcc/gensupport.c
index 3660378..3bff170 100644
--- a/gcc/gensupport.c
+++ b/gcc/gensupport.c
@@ -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;
}