]> git.sur5r.net Git - i3/i3/commitdiff
Free the string returned by g_markup_escape_text. 1898/head
authorIngo Bürk <ingo.buerk@tngtech.com>
Sat, 5 Sep 2015 14:21:16 +0000 (16:21 +0200)
committerIngo Bürk <ingo.buerk@tngtech.com>
Sat, 5 Sep 2015 14:21:16 +0000 (16:21 +0200)
fixes #1896

libi3/string.c

index a7b8c6fc4f1a6be6917106423cb58616500d8b66..7741fde064f0ade5ab81583d802c3e593f7cdcc1 100644 (file)
@@ -194,7 +194,10 @@ void i3string_set_markup(i3String *str, bool is_markup) {
 i3String *i3string_escape_markup(i3String *str) {
 #if PANGO_SUPPORT
     const char *text = i3string_as_utf8(str);
-    return i3string_from_utf8(g_markup_escape_text(text, -1));
+    char *escaped = g_markup_escape_text(text, -1);
+    i3String *result = i3string_from_utf8(escaped);
+    free(escaped);
+    return result;
 #else
     return str;
 #endif