summaryrefslogtreecommitdiff
path: root/xprop.c
diff options
context:
space:
mode:
Diffstat (limited to 'xprop.c')
-rw-r--r--xprop.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xprop.c b/xprop.c
index 55feaab..f220604 100644
--- a/xprop.c
+++ b/xprop.c
@@ -894,7 +894,7 @@ static const char *
Format_Len_Text (const char *string, int len, Atom encoding)
{
XTextProperty textprop;
- char **list;
+ char **list, **start_list;
int count;
/* Try to convert to local encoding. */
@@ -902,7 +902,8 @@ Format_Len_Text (const char *string, int len, Atom encoding)
textprop.format = 8;
textprop.value = (unsigned char *) string;
textprop.nitems = len;
- if (XmbTextPropertyToTextList(dpy, &textprop, &list, &count) == Success) {
+ if (XmbTextPropertyToTextList(dpy, &textprop, &start_list, &count) == Success) {
+ list = start_list;
_buf_ptr = _formatting_buffer;
_buf_len = MAXSTR;
*_buf_ptr++ = '"';
@@ -936,6 +937,7 @@ Format_Len_Text (const char *string, int len, Atom encoding)
_buf_len -= 4;
}
}
+ XFreeStringList(start_list);
*_buf_ptr++ = '"';
*_buf_ptr++ = '\0';
return _formatting_buffer;