diff options
author | alanm <alanm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-11-15 16:50:48 +0000 |
---|---|---|
committer | alanm <alanm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-11-15 16:50:48 +0000 |
commit | 463582fa6d79e17e545dac0cfcc623943a82de87 (patch) | |
tree | 561920af7814b557a8c9460a0adf8c0913d807fa /gcc/gensupport.c | |
parent | 69773da096e870da618abe3d70a75faadcae9d7e (diff) | |
download | gcc-463582fa6d79e17e545dac0cfcc623943a82de87.tar.gz |
2001-11-15 Alan Matsuoka <alanm@redhat.com>
* gensupport.c process_include : Change call to alloca to
xmalloc.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47062 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gensupport.c')
-rw-r--r-- | gcc/gensupport.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/gensupport.c b/gcc/gensupport.c index 3660378d7cf..3bff1708295 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; } |