From 8d4283d6fc2301e01cc963fd797fc8c5a2217ea6 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Mon, 29 Oct 2001 18:31:40 +0000 Subject: 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 --- camel/providers/imap/camel-imap-store.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'camel/providers') 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) -- cgit v1.2.3