mirror of
https://github.com/gcc-mirror/gcc.git
synced 2024-11-21 13:40:47 +00:00
Replace alloca with xmalloc/free
PR binutils/14526 * argv.c (buildargv): Replace alloca with xmalloc/free. From-SVN: r190766
This commit is contained in:
parent
09ba405a48
commit
55529d369c
@ -1,3 +1,8 @@
|
|||||||
|
2011-08-28 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
PR binutils/14526
|
||||||
|
* argv.c (buildargv): Replace alloca with xmalloc/free.
|
||||||
|
|
||||||
2012-08-17 Andreas Schwab <schwab@linux-m68k.org>
|
2012-08-17 Andreas Schwab <schwab@linux-m68k.org>
|
||||||
|
|
||||||
* floatformat.c (floatformat_to_double): Correctly handle numbers
|
* floatformat.c (floatformat_to_double): Correctly handle numbers
|
||||||
|
@ -191,7 +191,7 @@ char **buildargv (const char *input)
|
|||||||
|
|
||||||
if (input != NULL)
|
if (input != NULL)
|
||||||
{
|
{
|
||||||
copybuf = (char *) alloca (strlen (input) + 1);
|
copybuf = (char *) xmalloc (strlen (input) + 1);
|
||||||
/* Is a do{}while to always execute the loop once. Always return an
|
/* Is a do{}while to always execute the loop once. Always return an
|
||||||
argv, even for null strings. See NOTES above, test case below. */
|
argv, even for null strings. See NOTES above, test case below. */
|
||||||
do
|
do
|
||||||
@ -297,6 +297,8 @@ char **buildargv (const char *input)
|
|||||||
consume_whitespace (&input);
|
consume_whitespace (&input);
|
||||||
}
|
}
|
||||||
while (*input != EOS);
|
while (*input != EOS);
|
||||||
|
|
||||||
|
free (copybuf);
|
||||||
}
|
}
|
||||||
return (argv);
|
return (argv);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user