From 044fde0583993fae3ec3c511ac0a5058c5745302 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 13 Apr 2001 21:36:09 +0000 Subject: Plug leaks. * camel-object.c (camel_object_hook_event): * camel-uid-cache.c (camel_uid_cache_get_new_uids): * camel-url.c (camel_url_new_with_base): Plug leaks. * camel-remote-store.c (camel_remote_store_init): Don't re-initialize the folders hash table. * providers/imap/camel-imap-store.c (imap_disconnect): Free authtypes since they'll be re-read on re-connect. (get_folder_info): Free folderinfos that we're discarding from the list. svn path=/trunk/; revision=9302 --- camel/camel-uid-cache.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'camel/camel-uid-cache.c') diff --git a/camel/camel-uid-cache.c b/camel/camel-uid-cache.c index 0997e9a6a7..fcea86f608 100644 --- a/camel/camel-uid-cache.c +++ b/camel/camel-uid-cache.c @@ -153,6 +153,7 @@ GPtrArray * camel_uid_cache_get_new_uids (CamelUIDCache *cache, GPtrArray *uids) { GPtrArray *new_uids; + gpointer old_uid, old_level; char *uid; int i; @@ -161,9 +162,11 @@ camel_uid_cache_get_new_uids (CamelUIDCache *cache, GPtrArray *uids) for (i = 0; i < uids->len; i++) { uid = uids->pdata[i]; - if (g_hash_table_lookup (cache->uids, uid)) + if (g_hash_table_lookup_extended (cache->uids, uid, + &old_uid, &old_level)) { g_hash_table_remove (cache->uids, uid); - else + g_free (old_uid); + } else g_ptr_array_add (new_uids, g_strdup (uid)); g_hash_table_insert (cache->uids, g_strdup (uid), GINT_TO_POINTER (cache->level)); -- cgit v1.2.3