From 5a4a23e5e8032dfa1f7b73facb32f0c9ab200765 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Fri, 23 Dec 2022 02:01:36 -0500 Subject: [PATCH] Fix memory leak in ewmh_probe_wm_icon. The data returned by XGetWindowProperty must be freed by the caller; this didn't happen so there is a small leak in this function. Simple enough to fix. --- src/ewmhicon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ewmhicon.c b/src/ewmhicon.c index e0ab8a5..319ed3a 100644 --- a/src/ewmhicon.c +++ b/src/ewmhicon.c @@ -152,9 +152,11 @@ int ewmh_probe_wm_icon(Widget shell) props = (void *)prop_return; for (i = 0; i < nitems; i++) { if (props[i] == net_wm_icon) { + XFree(props); return 1; } } + XFree(props); } while (nitems > 0 && bytes_after > 0); return 0; -- 2.43.2