From 70c4b5bdc6d5e534e1a23c05da1b60c47243a192 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 11 May 2022 06:56:43 +0000 Subject: [PATCH] Fix event memory leak on Haiku * src/haikuterm.c (haiku_read_socket): Allocate event buffer on the stack. --- src/haikuterm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/haikuterm.c b/src/haikuterm.c index a7403314823..ec6a8f0cea1 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -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) { -- 2.39.2