From: Po Lu Date: Fri, 14 Jan 2022 09:46:50 +0000 (+0000) Subject: Fix leak when refs are sent to a frame during destruction on Haiku X-Git-Tag: emacs-29.0.90~3058 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e0268fd7d54bb691da1d68fafa3707ec6417a3d2;p=emacs.git 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. --- 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);