summaryrefslogtreecommitdiff
path: root/src/haikuterm.c
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-05-11 06:56:43 +0000
committerPo Lu <luangruo@yahoo.com>2022-05-11 06:56:43 +0000
commit70c4b5bdc6d5e534e1a23c05da1b60c47243a192 (patch)
tree261530a65f6580d6e90d32f145ebe97f636b6a0d /src/haikuterm.c
parent80951f764b7053f93d69ac5c73c0e504ab308450 (diff)
downloademacs-70c4b5bdc6d5e534e1a23c05da1b60c47243a192.tar.gz
Fix event memory leak on Haiku
* src/haikuterm.c (haiku_read_socket): Allocate event buffer on the stack.
Diffstat (limited to 'src/haikuterm.c')
-rw-r--r--src/haikuterm.c5
1 files 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)
{