diff options
author | Carlos Garcia Campos <carlosgc@gnome.org> | 2008-02-27 17:58:26 (GMT) |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@src.gnome.org> | 2008-02-27 17:58:26 (GMT) |
commit | 0b94e1fcf335f0131e5ff81cbe87b2e9ac343ab6 (patch) | |
tree | 083e897c58335fb2189c74fc20e435da0639cf51 /libdocument/ev-document-factory.c | |
parent | d1b42341039d4e26cf299c2fc50d36cd18760011 (diff) |
Duplicate mime_type string before freeing it so that it doesn't always
2008-02-27 Carlos Garcia Campos <carlosgc@gnome.org>
* libdocument/ev-document-factory.c: (get_mime_type_from_uri):
Duplicate mime_type string before freeing it so that it doesn't
always fail when getting mime type from uri. Fixes bug #518874.
svn path=/trunk/; revision=2931
Diffstat (limited to 'libdocument/ev-document-factory.c')
-rw-r--r-- | libdocument/ev-document-factory.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libdocument/ev-document-factory.c b/libdocument/ev-document-factory.c index 5b2473f..962f42a 100644 --- a/libdocument/ev-document-factory.c +++ b/libdocument/ev-document-factory.c @@ -106,9 +106,9 @@ get_compression_from_mime_type (const gchar *mime_type) static gchar * get_mime_type_from_uri (const gchar *uri) { - GFile *file; - GFileInfo *file_info; - const gchar *mime_type; + GFile *file; + GFileInfo *file_info; + gchar *mime_type; file = g_file_new_for_uri (uri); file_info = g_file_query_info (file, @@ -119,10 +119,10 @@ get_mime_type_from_uri (const gchar *uri) if (file_info == NULL) return NULL; - mime_type = g_file_info_get_content_type (file_info); + mime_type = g_strdup (g_file_info_get_content_type (file_info)); g_object_unref (file_info); - return g_strdup (mime_type); + return mime_type; } static gchar * @@ -169,7 +169,7 @@ get_document_from_uri (const char *uri, mime_type = slow ? get_mime_type_from_data (uri) : get_mime_type_from_uri (uri); - + if (mime_type == NULL) { g_set_error (error, EV_DOCUMENT_ERROR, |