]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix event memory leak on Haiku
authorPo Lu <luangruo@yahoo.com>
Wed, 11 May 2022 06:56:43 +0000 (06:56 +0000)
committerPo Lu <luangruo@yahoo.com>
Wed, 11 May 2022 06:56:43 +0000 (06:56 +0000)
* src/haikuterm.c (haiku_read_socket): Allocate event buffer on
the stack.

src/haikuterm.c

index a7403314823d83d244c5e0b312bdc66b1b88b068..ec6a8f0cea17a7874ac1c60662e0a3dbcd5ad346 100644 (file)
@@ -3007,11 +3007,10 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit)
   message_count = 0;
   button_or_motion_p = 0;
   do_help = 0;
-  buf = NULL;
+
+  buf = alloca (200);
 
   block_input ();
-  if (!buf)
-    buf = xmalloc (200);
   haiku_read_size (&b_size, false);
   while (b_size >= 0)
     {