evince r3472 - in trunk: . libdocument
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: evince r3472 - in trunk: . libdocument
- Date: Mon, 16 Feb 2009 14:17:27 +0000 (UTC)
Author: chpe
Date: Mon Feb 16 14:17:26 2009
New Revision: 3472
URL: http://svn.gnome.org/viewvc/evince?rev=3472&view=rev
Log:
* libdocument/ev-file-helpers.c: (get_mime_type_from_uri): Fix a freed
memory read.
Modified:
trunk/ChangeLog
trunk/libdocument/ev-file-helpers.c
Modified: trunk/libdocument/ev-file-helpers.c
==============================================================================
--- trunk/libdocument/ev-file-helpers.c (original)
+++ trunk/libdocument/ev-file-helpers.c Mon Feb 16 14:17:26 2009
@@ -222,6 +222,7 @@
GFile *file;
GFileInfo *file_info;
const gchar *content_type;
+ gchar *mime_type = NULL;
file = g_file_new_for_uri (uri);
file_info = g_file_query_info (file,
@@ -233,12 +234,12 @@
return NULL;
content_type = g_file_info_get_content_type (file_info);
- g_object_unref (file_info);
-
- if (!content_type)
- return NULL;
+ if (content_type) {
+ mime_type = g_content_type_get_mime_type (content_type);
+ }
- return g_content_type_get_mime_type (content_type);
+ g_object_unref (file_info);
+ return mime_type;
}
static gchar *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]