From: Carlos Garcia Campos Date: Mon, 20 Dec 2010 19:38:13 +0000 (+0100) Subject: shell: Fix double free X-Git-Tag: EVINCE_2_91_4~22 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=e2147ba4018aeeaac89fa900ae4bc26ee8ee69b4;p=evince.git shell: Fix double free --- diff --git a/shell/ev-window-title.c b/shell/ev-window-title.c index 9e26c21b..94dd3331 100644 --- a/shell/ev-window-title.c +++ b/shell/ev-window-title.c @@ -142,14 +142,15 @@ ev_window_title_update (EvWindowTitle *window_title) } if (title && window_title->uri) { - char *tmp_title = title; + char *tmp_title; char *filename = get_filename_from_uri (window_title->uri); ev_window_title_sanitize_title (window_title, &title); - title = g_strdup_printf ("%s — %s", filename, title); - - g_free (tmp_title); - g_free (filename); + tmp_title = g_strdup_printf ("%s — %s", filename, title); + g_free (title); + g_free (filename); + + title = tmp_title; } else if (window_title->uri) { title = get_filename_from_uri (window_title->uri); } else if (!title) {