From a5fcd7b5d797115135e308e9a25f8436c0462714 Mon Sep 17 00:00:00 2001 From: Charles Lehner Date: Tue, 21 Jul 2015 20:43:44 -0400 Subject: [PATCH] managesieve: fix memory leak --- src/plugins/managesieve/sieve_editor.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/managesieve/sieve_editor.c b/src/plugins/managesieve/sieve_editor.c index f8b43eeb2..2931c8684 100644 --- a/src/plugins/managesieve/sieve_editor.c +++ b/src/plugins/managesieve/sieve_editor.c @@ -158,12 +158,14 @@ static void sieve_editor_set_status_icon(SieveEditorPage *page, const gchar *img } static void sieve_editor_append_status(SieveEditorPage *page, - const gchar *status) + const gchar *new_status) { GtkLabel *label = GTK_LABEL(page->status_text); const gchar *prev_status = gtk_label_get_text(label); const gchar *sep = prev_status && prev_status[0] ? "\n" : ""; - gtk_label_set_text(label, g_strconcat(prev_status, sep, status, NULL)); + gchar *status = g_strconcat(prev_status, sep, new_status, NULL); + gtk_label_set_text(label, status); + g_free(status); } /* Update the status icon and text from a response. */ -- 2.25.1