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



commit 92d8efb8e9cc228a1cf404f05eae2894f05897ac
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 76d6f80..9224a62 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]