aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-10-30 02:31:40 +0800
committerDan Winship <danw@src.gnome.org>2001-10-30 02:31:40 +0800
commit8d4283d6fc2301e01cc963fd797fc8c5a2217ea6 (patch)
tree1876c13b86aea3a33f1384991afcb30f25534cb3 /camel/providers/imap
parentd725eacdbc6eefb19791a10cf838d7db9359b04d (diff)
downloadgsoc2013-evolution-8d4283d6fc2301e01cc963fd797fc8c5a2217ea6.tar
gsoc2013-evolution-8d4283d6fc2301e01cc963fd797fc8c5a2217ea6.tar.gz
gsoc2013-evolution-8d4283d6fc2301e01cc963fd797fc8c5a2217ea6.tar.bz2
gsoc2013-evolution-8d4283d6fc2301e01cc963fd797fc8c5a2217ea6.tar.lz
gsoc2013-evolution-8d4283d6fc2301e01cc963fd797fc8c5a2217ea6.tar.xz
gsoc2013-evolution-8d4283d6fc2301e01cc963fd797fc8c5a2217ea6.tar.zst
gsoc2013-evolution-8d4283d6fc2301e01cc963fd797fc8c5a2217ea6.zip
Don't free the hash table key if the folder wasn't found in the hash
* providers/imap/camel-imap-store.c (unsubscribe_folder): Don't free the hash table key if the folder wasn't found in the hash table. I'm not sure where the bug is/was that made it possible to add a folder to the tree after creating it failed, but now if that happens, it won't crash if you try to delete it again. (#11492) svn path=/trunk/; revision=14348
Diffstat (limited to 'camel/providers/imap')
-rw-r--r--camel/providers/imap/camel-imap-store.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index f429ef6a76..5e7cd62bf6 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -1757,10 +1757,11 @@ unsubscribe_folder (CamelStore *store, const char *folder_name,
return;
camel_imap_response_free (imap_store, response);
- g_hash_table_lookup_extended (imap_store->subscribed_folders,
- folder_name, &key, &value);
- g_hash_table_remove (imap_store->subscribed_folders, folder_name);
- g_free (key);
+ if (g_hash_table_lookup_extended (imap_store->subscribed_folders,
+ folder_name, &key, &value)) {
+ g_hash_table_remove (imap_store->subscribed_folders, key);
+ g_free (key);
+ }
name = strrchr (folder_name, imap_store->dir_sep);
if (name)