diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-07-13 09:18:35 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-07-13 11:49:07 +1000 |
commit | 7baaba9fbef48b1f45a51c1654e605df074800b8 (patch) | |
tree | 78b81e51f768ebd3096e6ce0d28c613b0d16c51e /src | |
parent | cb93b032989907e5274d9a5d95ae01535001ec19 (diff) |
test_xi2: Plug memory leak with XGetAtomName.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/test_xi2.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test_xi2.c b/src/test_xi2.c index 6bad866..cef019c 100644 --- a/src/test_xi2.c +++ b/src/test_xi2.c @@ -196,6 +196,7 @@ static void print_enterleave(XILeaveEvent* event) static void print_propertyevent(Display *display, XIPropertyEvent* event) { char *changed; + char *name; if (event->what == XIPropertyDeleted) changed = "deleted"; @@ -203,10 +204,11 @@ static void print_propertyevent(Display *display, XIPropertyEvent* event) changed = "created"; else changed = "modified"; - - printf(" property: %ld '%s'\n", event->property, XGetAtomName(display, event->property)); + name = XGetAtomName(display, event->property); + printf(" property: %ld '%s'\n", event->property, name); printf(" changed: %s\n", changed); + XFree(name); } void test_sync_grab(Display *display, Window win) |