]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Fixed using freed memory when opening mailboxes.
authorTimo Sirainen <tss@iki.fi>
Mon, 15 Jun 2009 21:35:28 +0000 (17:35 -0400)
committerTimo Sirainen <tss@iki.fi>
Mon, 15 Jun 2009 21:35:28 +0000 (17:35 -0400)
--HG--
branch : HEAD

src/lib-storage/index/index-storage.c

index 7888fcefadfc37eaea176298b2c18a3ccc6b922f..230de5a7d46169d28c262b6e5d2da03f4d0cbdeb 100644 (file)
@@ -186,7 +186,7 @@ index_storage_alloc(struct mailbox_list *list, const char *name,
                                match = rec;
                }
 
-               if (rec->refcount == 0) {
+               if (rec->refcount == 0 && rec != match) {
                        if (rec->destroy_time <= ioloop_time ||
                            destroy_count >= INDEX_CACHE_MAX) {
                                *indexp = rec->next;