diff options
author | Eirik Byrkjeflot Anonsen <eirik@eirikba.org> | 2015-05-22 11:10:03 +0200 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2015-09-28 16:04:08 -0400 |
commit | 52c9aa32c8f1b787de7b68d9bb843fa7270cbaaf (patch) | |
tree | 0ce43e238d2a9e293e0f37f3577f65879aeb7347 | |
parent | dee1d0c1316b1c62c6c62d6f0f4b13685e8e6630 (diff) |
Free the data returned by XGetWindowProperty()
Signed-off-by: Eirik Byrkjeflot Anonsen <eirik@eirikba.org>
-rw-r--r-- | xprop.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1423,9 +1423,15 @@ Get_Window_Property_Data_And_Type (Atom atom, unsigned long nitems; unsigned long nbytes; unsigned long bytes_after; - unsigned char *prop; + static unsigned char *prop = NULL; int status; - + + if (prop) + { + XFree(prop); + prop = NULL; + } + status = XGetWindowProperty(dpy, target_win, atom, 0, (max_len+3)/4, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, |