]> git.eshelyaron.com Git - emacs.git/commitdiff
(add_to_log): Use SAFE_ALLOCA.
authorKim F. Storm <storm@cua.dk>
Mon, 21 Jun 2004 21:55:56 +0000 (21:55 +0000)
committerKim F. Storm <storm@cua.dk>
Mon, 21 Jun 2004 21:55:56 +0000 (21:55 +0000)
src/xdisp.c

index cd712ac7485ab952fc452ceeab494cc011ef65d8..c92a8ee79d25a6cce630e7f492feac084e0f9d49 100644 (file)
@@ -6315,6 +6315,7 @@ add_to_log (format, arg1, arg2)
   char *buffer;
   int len;
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
+  USE_SAFE_ALLOCA;
 
   /* Do nothing if called asynchronously.  Inserting text into
      a buffer may call after-change-functions and alike and
@@ -6331,10 +6332,12 @@ add_to_log (format, arg1, arg2)
   msg = Fformat (3, args);
 
   len = SBYTES (msg) + 1;
-  buffer = (char *) alloca (len);
+  SAFE_ALLOCA (buffer, char *, len);
   bcopy (SDATA (msg), buffer, len);
 
   message_dolog (buffer, len - 1, 1, 0);
+  SAFE_FREE (len);
+
   UNGCPRO;
 }