mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-29 01:55:08 +08:00
(do_error, do_warning): Fix memory leak.
From-SVN: r13752
This commit is contained in:
parent
982ce90579
commit
52320a474f
@ -6721,7 +6721,7 @@ do_error (buf, limit, op, keyword)
|
||||
struct directive *keyword;
|
||||
{
|
||||
int length = limit - buf;
|
||||
U_CHAR *copy = (U_CHAR *) xmalloc (length + 1);
|
||||
U_CHAR *copy = (U_CHAR *) alloca (length + 1);
|
||||
bcopy ((char *) buf, (char *) copy, length);
|
||||
copy[length] = 0;
|
||||
SKIP_WHITE_SPACE (copy);
|
||||
@ -6740,7 +6740,7 @@ do_warning (buf, limit, op, keyword)
|
||||
struct directive *keyword;
|
||||
{
|
||||
int length = limit - buf;
|
||||
U_CHAR *copy = (U_CHAR *) xmalloc (length + 1);
|
||||
U_CHAR *copy = (U_CHAR *) alloca (length + 1);
|
||||
bcopy ((char *) buf, (char *) copy, length);
|
||||
copy[length] = 0;
|
||||
SKIP_WHITE_SPACE (copy);
|
||||
|
@ -3880,7 +3880,7 @@ do_error (pfile, keyword, buf, limit)
|
||||
U_CHAR *buf, *limit;
|
||||
{
|
||||
int length = limit - buf;
|
||||
U_CHAR *copy = (U_CHAR *) xmalloc (length + 1);
|
||||
U_CHAR *copy = (U_CHAR *) alloca (length + 1);
|
||||
bcopy (buf, copy, length);
|
||||
copy[length] = 0;
|
||||
SKIP_WHITE_SPACE (copy);
|
||||
@ -3901,7 +3901,7 @@ do_warning (pfile, keyword, buf, limit)
|
||||
U_CHAR *buf, *limit;
|
||||
{
|
||||
int length = limit - buf;
|
||||
U_CHAR *copy = (U_CHAR *) xmalloc (length + 1);
|
||||
U_CHAR *copy = (U_CHAR *) alloca (length + 1);
|
||||
bcopy (buf, copy, length);
|
||||
copy[length] = 0;
|
||||
SKIP_WHITE_SPACE (copy);
|
||||
|
Loading…
Reference in New Issue
Block a user