OSDN Git Service

(do_error, do_warning): Fix memory leak.
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Mar 1997 22:19:27 +0000 (22:19 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Mar 1997 22:19:27 +0000 (22:19 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13752 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cccp.c
gcc/cpplib.c

index 0033e6b..cd02b59 100644 (file)
@@ -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);
index 92820da..f7e43ff 100644 (file)
@@ -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);