From 023fe67c5bb05d0f7a3ebc7cdbc89ef2bddb5610 Mon Sep 17 00:00:00 2001 From: Jonas Witschel Date: Thu, 23 Apr 2020 14:44:02 +0200 Subject: [PATCH] Fix double free when both allow_markup and parse_search are enabled If out is not initialised, GLib will attempt to free the string automagically later, leading to a crash. To reproduce, try running wofi --define parse_search=true --define allow_markup=true --show dmenu,drun --- src/wofi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wofi.c b/src/wofi.c index c8745e2..b71f094 100644 --- a/src/wofi.c +++ b/src/wofi.c @@ -384,7 +384,7 @@ static GtkWidget* create_label(char* mode, char* text, char* search_text, char* free(tmp); } if(allow_markup) { - char* out; + char* out = NULL; pango_parse_markup(search_text, -1, 0, NULL, &out, NULL, NULL); free(search_text); search_text = out;