summaryrefslogtreecommitdiff
path: root/app/cwm
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2020-04-25 20:07:29 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2020-04-25 20:07:29 +0000
commitb5e977ed29995e30bcb3bcaa2f009f996bd94d3e (patch)
treeedda26e1c02a2920a8feffe70e92a5b3337554af /app/cwm
parent77fc86c297e6ee423f9838615c17e346912879bf (diff)
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@
Diffstat (limited to 'app/cwm')
-rw-r--r--app/cwm/xutil.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/cwm/xutil.c b/app/cwm/xutil.c
index 01a7dc501..8d92b5070 100644
--- a/app/cwm/xutil.c
+++ b/app/cwm/xutil.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: xutil.c,v 1.112 2020/03/24 14:47:29 okan Exp $
+ * $OpenBSD: xutil.c,v 1.113 2020/04/25 20:07:28 tobias Exp $
*/
#include <sys/types.h>
@@ -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) {