summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEirik Byrkjeflot Anonsen <eirik@eirikba.org>2015-05-22 11:10:05 +0200
committerAdam Jackson <ajax@redhat.com>2015-09-28 16:04:56 -0400
commitfa732adbbf5e29f4bb230e9b7c0c91ccb4b5af7e (patch)
tree233fc59a5b641367d8b7065892b246b56633e507
parent52c9aa32c8f1b787de7b68d9bb843fa7270cbaaf (diff)
Free the data returned by Format_Icons()
Signed-off-by: Eirik Byrkjeflot Anonsen <eirik@eirikba.org>
-rw-r--r--xprop.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/xprop.c b/xprop.c
index 795cedd..e7a66d9 100644
--- a/xprop.c
+++ b/xprop.c
@@ -750,10 +750,14 @@ is_utf8_locale (void)
static const char *
Format_Icons (const unsigned long *icon, int len)
{
- char *result = NULL, *tail = NULL;
+ static char *result = NULL;
+ char *tail = NULL;
int alloced;
const unsigned long *end = icon + len / sizeof (unsigned long);
+ free(result);
+ result = NULL;
+
alloced = 0;
while (icon < end)