changeset 5828:496b7dad3938 HEAD

Don't access freed memory
author Timo Sirainen <tss@iki.fi>
date Thu, 28 Jun 2007 22:34:59 +0300
parents f17d4bccd74d
children 1d73153584d2
files src/lib-index/mail-index-sync-update.c
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index-sync-update.c	Thu Jun 28 22:34:50 2007 +0300
+++ b/src/lib-index/mail-index-sync-update.c	Thu Jun 28 22:34:59 2007 +0300
@@ -822,10 +822,9 @@
 	/* restore refcount before closing the view. this is necessary also
 	   if map got cloned, because view closing would otherwise destroy it */
 	map->refcount++;
+	mail_index_sync_map_deinit(&sync_map_ctx);
 	mail_index_view_close(&view);
 
-	mail_index_sync_map_deinit(&sync_map_ctx);
-
 	i_assert(index->map == map || type == MAIL_INDEX_SYNC_HANDLER_VIEW);
 
 	*_map = map;