diff options
author | Carlos Garnacho <carlos@imendio.com> | 2008-06-27 15:33:42 +0000 |
---|---|---|
committer | Carlos Garnacho <carlosg@src.gnome.org> | 2008-06-27 15:33:42 +0000 |
commit | b3bb8c47b5c0eac159108a29a4325de8bd2360a2 (patch) | |
tree | d23f631514bff9c3f019c639e48fe8a4c1d8e29b /gtk/gtkrecentmanager.c | |
parent | e27632cd6d7c8b510b3ae4c4ca044fd09d634e37 (diff) | |
download | gtk+-b3bb8c47b5c0eac159108a29a4325de8bd2360a2.tar.gz |
Fix two potential critical warnings. Bug #539470.
2008-06-27 Carlos Garnacho <carlos@imendio.com>
* gtk/gtkrecentmanager.c (get_icon_for_mime_type): Fix two potential
critical warnings. Bug #539470.
svn path=/trunk/; revision=20696
Diffstat (limited to 'gtk/gtkrecentmanager.c')
-rw-r--r-- | gtk/gtkrecentmanager.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk/gtkrecentmanager.c b/gtk/gtkrecentmanager.c index 1b24425384..fea41ad658 100644 --- a/gtk/gtkrecentmanager.c +++ b/gtk/gtkrecentmanager.c @@ -1889,15 +1889,22 @@ get_icon_for_mime_type (const char *mime_type, icon_theme = gtk_icon_theme_get_default (); content_type = g_content_type_from_mime_type (mime_type); + + if (!content_type) + return NULL; + icon = g_content_type_get_icon (content_type); info = gtk_icon_theme_lookup_by_gicon (icon_theme, icon, pixel_size, GTK_ICON_LOOKUP_USE_BUILTIN); - pixbuf = gtk_icon_info_load_icon (info, NULL); - g_free (content_type); g_object_unref (icon); + + if (!info) + return NULL; + + pixbuf = gtk_icon_info_load_icon (info, NULL); gtk_icon_info_free (info); return pixbuf; |