Commit 32165b17 authored by Christian Persch's avatar Christian Persch Committed by Carlos Garcia Campos

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.
parent 1f59c737
...@@ -86,7 +86,7 @@ ev_properties_get_pages (NautilusPropertyPageProvider *provider, ...@@ -86,7 +86,7 @@ ev_properties_get_pages (NautilusPropertyPageProvider *provider,
GList *files) GList *files)
{ {
GError *error = NULL; GError *error = NULL;
EvDocument *document; EvDocument *document = NULL;
GList *pages = NULL; GList *pages = NULL;
NautilusFileInfo *file; NautilusFileInfo *file;
gchar *uri = NULL; gchar *uri = NULL;
...@@ -120,14 +120,16 @@ ev_properties_get_pages (NautilusPropertyPageProvider *provider, ...@@ -120,14 +120,16 @@ ev_properties_get_pages (NautilusPropertyPageProvider *provider,
gtk_widget_show (page); gtk_widget_show (page);
property_page = nautilus_property_page_new ("document-properties", property_page = nautilus_property_page_new ("document-properties",
label, page); label, page);
g_object_unref (document);
pages = g_list_prepend (pages, property_page); pages = g_list_prepend (pages, property_page);
end: end:
g_free (uri); g_free (uri);
g_free (mime_type); g_free (mime_type);
if (document != NULL)
g_object_unref (document);
return pages; return pages;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment