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>
This commit is contained in:
Haroldo Santos
2026-06-15 17:29:07 +01:00
committed by Carlos R. Mafra
co-authored by Copilot
parent 90ce10998c
commit 7c80e917d7
+2
View File
@@ -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);