summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEirik Byrkjeflot Anonsen <eirik@eirikba.org>2015-05-22 11:10:03 +0200
committerAdam Jackson <ajax@redhat.com>2015-09-28 16:04:08 -0400
commit52c9aa32c8f1b787de7b68d9bb843fa7270cbaaf (patch)
tree0ce43e238d2a9e293e0f37f3577f65879aeb7347
parentdee1d0c1316b1c62c6c62d6f0f4b13685e8e6630 (diff)
Free the data returned by XGetWindowProperty()
Signed-off-by: Eirik Byrkjeflot Anonsen <eirik@eirikba.org>
-rw-r--r--xprop.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/xprop.c b/xprop.c
index 7d20ca1..795cedd 100644
--- a/xprop.c
+++ b/xprop.c
@@ -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,