changeset 56196:abdb38fe88c5

(add_to_log): Use SAFE_ALLOCA.
author Kim F. Storm <storm@cua.dk>
date Mon, 21 Jun 2004 21:55:56 +0000
parents 3204d2175b6a
children fb8588385aac
files src/xdisp.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Mon Jun 21 21:55:15 2004 +0000
+++ b/src/xdisp.c	Mon Jun 21 21:55:56 2004 +0000
@@ -6315,6 +6315,7 @@
   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 @@
   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;
 }