From d3c6e3673123a3346758d60e54a7cdcc1e22918f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ingo=20B=C3=BCrk?= Date: Sat, 5 Sep 2015 16:21:16 +0200 Subject: [PATCH] Free the string returned by g_markup_escape_text. fixes #1896 --- libi3/string.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libi3/string.c b/libi3/string.c index a7b8c6fc..7741fde0 100644 --- a/libi3/string.c +++ b/libi3/string.c @@ -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 -- 2.39.5