From 7c80e917d7c5e665c779dcbde9f3559e84d57c12 Mon Sep 17 00:00:00 2001 From: Haroldo Santos Date: Mon, 15 Jun 2026 08:19:23 -0400 Subject: [PATCH] wmsetbg: fix memory leak of XGetWindowProperty data in setPixmapProperty XGetWindowProperty() allocates a buffer and returns it via the 'data' pointer; the caller is responsible for freeing it with XFree() when done. setPixmapProperty() read the old _XROOTPMAP_ID value but never freed the returned buffer, leaking memory on every background change. Add the missing XFree(data) call. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- util/wmsetbg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/wmsetbg.c b/util/wmsetbg.c index dc747d04..5e75ca0e 100644 --- a/util/wmsetbg.c +++ b/util/wmsetbg.c @@ -829,6 +829,8 @@ static void setPixmapProperty(Pixmap pixmap) /* Clear out the old pixmap */ XGetWindowProperty(dpy, root, prop, 0L, 1L, False, AnyPropertyType, &type, &format, &length, &after, &data); + if (data) + XFree(data); if ((type == XA_PIXMAP) && (format == 32) && (length == 1)) { XSetErrorHandler(dummyErrorHandler);