From 22ce877d810020ae69dd1509a4a5d3c3b55836d0 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Fri, 31 Aug 2012 12:30:49 +0200 Subject: yelp-view: Don't free the passed GError in view_show_error_page() The error should be considered as a const parameter, and it should be freed by the caller that created it. https://bugzilla.gnome.org/show_bug.cgi?id=683100 --- libyelp/yelp-document.c | 2 +- libyelp/yelp-view.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'libyelp') diff --git a/libyelp/yelp-document.c b/libyelp/yelp-document.c index 1a4ff0a7..8794682d 100644 --- a/libyelp/yelp-document.c +++ b/libyelp/yelp-document.c @@ -1437,7 +1437,6 @@ request_idle_error (Request *request) callback = request->callback; user_data = request->user_data; error = request->error; - request->error = NULL; priv->reqs_pending = g_slist_remove (priv->reqs_pending, request); } @@ -1450,6 +1449,7 @@ request_idle_error (Request *request) user_data, error); + g_clear_error (&request->error); g_object_unref (document); return FALSE; } diff --git a/libyelp/yelp-view.c b/libyelp/yelp-view.c index 5e21bbfc..31469875 100644 --- a/libyelp/yelp-view.c +++ b/libyelp/yelp-view.c @@ -1634,6 +1634,7 @@ view_load_page (YelpView *view) _("Could not load a document")); } view_show_error_page (view, error); + g_error_free (error); return; } @@ -1798,7 +1799,6 @@ view_show_error_page (YelpView *view, "UTF-8", "file:///error/"); g_signal_handler_unblock (view, priv->navigation_requested); - g_error_free (error); g_free (title_m); g_free (content_beg); if (content_end != NULL) @@ -2029,8 +2029,10 @@ uri_resolved (YelpUri *uri, if (error == NULL) view_load_page (view); - else + else { view_show_error_page (view, error); + g_error_free (error); + } } static void -- cgit v1.2.1