From e0268fd7d54bb691da1d68fafa3707ec6417a3d2 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 14 Jan 2022 09:46:50 +0000 Subject: [PATCH] Fix leak when refs are sent to a frame during destruction on Haiku * src/haikuterm.c (haiku_read_socket): Free b->ref if it was sent from a frame that was destroyed. --- src/haikuterm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/haikuterm.c b/src/haikuterm.c index 47199c139c6..3e99cc1c8d9 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -3235,7 +3235,10 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) struct frame *f = haiku_window_to_frame (b->window); if (!f) - continue; + { + free (b->ref); + continue; + } inev.kind = DRAG_N_DROP_EVENT; inev.arg = build_string_from_utf8 (b->ref); -- 2.39.2