From 2dbe4c632e6c6429de27bb1e7ab37b28071781ff Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Mon, 17 Sep 2012 22:15:55 +0300 Subject: [PATCH] Fix memory leak in PDF viewer --- clients/view.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clients/view.c b/clients/view.c index 394cc8a..8ecce8a 100644 --- a/clients/view.c +++ b/clients/view.c @@ -220,7 +220,7 @@ view_create(struct display *display, file = g_file_new_for_commandline_arg(filename); basename = g_file_get_basename(file); if(!basename) { - title = "Wayland View"; + title = g_strdup("Wayland View"); } else { title = g_strdup_printf("Wayland View - %s", basename); g_free(basename); @@ -230,12 +230,13 @@ view_create(struct display *display, NULL, &error); if(error) { - title = "File not found"; + title = g_strdup("File not found"); } view->window = window_create(display); view->widget = frame_create(view->window, view); window_set_title(view->window, title); + g_free(title); view->display = display; window_set_user_data(view->window, view); -- 2.7.4