aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2008-04-28 13:36:20 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2008-04-28 13:36:20 +0800
commit29d5ce762e725d1e6ac69efb02f13b64e98732aa (patch)
tree59efaca1138433a44b25856f55755371432f29f5
parent87307d86390edb84adbe686073c00a8294ecb827 (diff)
downloadgsoc2013-evolution-29d5ce762e725d1e6ac69efb02f13b64e98732aa.tar
gsoc2013-evolution-29d5ce762e725d1e6ac69efb02f13b64e98732aa.tar.gz
gsoc2013-evolution-29d5ce762e725d1e6ac69efb02f13b64e98732aa.tar.bz2
gsoc2013-evolution-29d5ce762e725d1e6ac69efb02f13b64e98732aa.tar.lz
gsoc2013-evolution-29d5ce762e725d1e6ac69efb02f13b64e98732aa.tar.xz
gsoc2013-evolution-29d5ce762e725d1e6ac69efb02f13b64e98732aa.tar.zst
gsoc2013-evolution-29d5ce762e725d1e6ac69efb02f13b64e98732aa.zip
Avoid crash while detecting mime types.
2008-04-28 Srinivasa Ragavan <sragavan@novell.com> * mail/em-utils.c: Avoid crash while detecting mime types. svn path=/trunk/; revision=35426
-rw-r--r--mail/ChangeLog4
-rw-r--r--mail/em-utils.c15
2 files changed, 13 insertions, 6 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index ca5f536275..45fc8d1b49 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,9 @@
2008-04-28 Srinivasa Ragavan <sragavan@novell.com>
+ * mail/em-utils.c: Avoid crash while detecting mime types.
+
+2008-04-28 Srinivasa Ragavan <sragavan@novell.com>
+
* mail/em-format-html.c: Fix the Mailer header display
2008-04-25 Milan Crha <mcrha@redhat.com>
diff --git a/mail/em-utils.c b/mail/em-utils.c
index 73379af0ed..5efa38a9cc 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -2240,6 +2240,7 @@ em_utils_snoop_type(CamelMimePart *part)
* 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 @@ em_utils_snoop_type(CamelMimePart *part)
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;