[evince/wip/bug654832: 6/13] properties-view: Don't leak the document if it's encrypted



commit 191b7fcbe381c3b9a0b59ae7571ca42c9832a876
Author: Christian Persch <chpe gnome org>
Date:   Sun Feb 14 21:26:22 2010 +0100

    properties-view: Don't leak the document if it's encrypted
    
    For encrypted documents, ev_document_load() returns a document *and*
    sets the GError; handle this.

 properties/ev-properties-main.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/properties/ev-properties-main.c b/properties/ev-properties-main.c
index 1a7cccd..8ac0222 100644
--- a/properties/ev-properties-main.c
+++ b/properties/ev-properties-main.c
@@ -86,7 +86,7 @@ ev_properties_get_pages (NautilusPropertyPageProvider *provider,
 			 GList *files)
 {
 	GError *error = NULL;
-	EvDocument *document;
+	EvDocument *document = NULL;
 	GList *pages = NULL;
 	NautilusFileInfo *file;
 	gchar *uri = NULL;
@@ -120,14 +120,16 @@ ev_properties_get_pages (NautilusPropertyPageProvider *provider,
 	gtk_widget_show (page);
 	property_page = nautilus_property_page_new ("document-properties",
 			label, page);
-	g_object_unref (document);
 
 	pages = g_list_prepend (pages, property_page);
 
 end:
 	g_free (uri);
 	g_free (mime_type);
-	
+
+	if (document != NULL)
+		g_object_unref (document);
+
 	return pages;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]