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
+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.
+
2008-02-27 Carlos Garcia Campos <carlosgc@gnome.org>
* shell/ev-view.c: (ev_view_form_field_choice_changed):
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,
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 *
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,