From 91c05f94032debb645c14c76c9911ea5cfba5d3c Mon Sep 17 00:00:00 2001 From: tobias Date: Sat, 25 Apr 2020 20:07:28 +0000 Subject: Fixed memory leak in xu_get_strprop. If a client calls XSetTextProperty for a window to clear all its properties, then allocated memory within libX11 is not freed. OK okan@ --- xutil.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xutil.c') diff --git a/xutil.c b/xutil.c index 37af7db..230a2c5 100644 --- a/xutil.c +++ b/xutil.c @@ -73,8 +73,10 @@ xu_get_strprop(Window win, Atom atm, char **text) { *text = NULL; XGetTextProperty(X_Dpy, win, &prop, atm); - if (!prop.nitems) + if (!prop.nitems) { + XFree(prop.value); return 0; + } if (Xutf8TextPropertyToTextList(X_Dpy, &prop, &list, &nitems) == Success && nitems > 0 && *list) { -- cgit 1.4.1