[PATCH weston 2/4] Fix memory leak in PDF viewer

Pekka Vuorela pvuorela at iki.fi
Mon Sep 17 12:15:55 PDT 2012


---
 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);
-- 
1.7.9.5



More information about the wayland-devel mailing list