evolution r35426 - trunk/mail



Author: sragavan
Date: Mon Apr 28 05:36:20 2008
New Revision: 35426
URL: http://svn.gnome.org/viewvc/evolution?rev=35426&view=rev

Log:
2008-04-28  Srinivasa Ragavan  <sragavan novell com>

	* mail/em-utils.c: Avoid crash while detecting mime types.


Modified:
   trunk/mail/ChangeLog
   trunk/mail/em-utils.c

Modified: trunk/mail/em-utils.c
==============================================================================
--- trunk/mail/em-utils.c	(original)
+++ trunk/mail/em-utils.c	Mon Apr 28 05:36:20 2008
@@ -2240,6 +2240,7 @@
 	 * that instead and if it returns "application/octet-stream"
 	 * try to do better with the filename check.
 	 */
+	CamelStream *mem;
 
 	if (magic_type) {
 		if (name_type
@@ -2261,12 +2262,14 @@
 	if (!types_cache)
 		types_cache = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, (GDestroyNotify) NULL);
 
-	tmp = g_hash_table_lookup (types_cache, res);
-	if (tmp) {
-		g_free (res);
-		res = tmp;
-	} else {
-		g_hash_table_insert (types_cache, res, res);
+	if (res) {
+		tmp = g_hash_table_lookup (types_cache, res);
+		if (tmp) {
+			g_free (res);
+			res = tmp;
+		} else {
+			g_hash_table_insert (types_cache, res, res);
+		}
 	}
 
 	return res;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]