mirror of
https://github.com/gryf/wmaker.git
synced 2026-06-18 00:15:25 +02:00
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:
committed by
Carlos R. Mafra
parent
90ce10998c
commit
7c80e917d7
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user