]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Fix to previous change: Don't access freed memory.
authorTimo Sirainen <tss@iki.fi>
Sat, 27 Mar 2010 03:03:57 +0000 (05:03 +0200)
committerTimo Sirainen <tss@iki.fi>
Sat, 27 Mar 2010 03:03:57 +0000 (05:03 +0200)
--HG--
branch : HEAD

src/lib-storage/mail-storage.c

index 1f5dbeb8ee4851980871033701b04586cc30cdce..d21d141dc259525c8d8f217f93f95e913d66fac5 100644 (file)
@@ -865,7 +865,7 @@ int mailbox_sync_deinit(struct mailbox_sync_context **_ctx,
                        struct mailbox_sync_status *status_r)
 {
        struct mailbox_sync_context *ctx = *_ctx;
-       struct mail_storage *storage = ctx->box->storage;
+       struct mailbox *box = ctx->box;
        const char *errormsg;
        enum mail_error error;
        int ret;
@@ -873,12 +873,12 @@ int mailbox_sync_deinit(struct mailbox_sync_context **_ctx,
        *_ctx = NULL;
 
        memset(status_r, 0, sizeof(*status_r));
-       ret = ctx->box->v.sync_deinit(ctx, status_r);
-       if (ret < 0 && ctx->box->inbox &&
-           !storage->user->inbox_open_error_logged) {
-               errormsg = mail_storage_get_last_error(storage, &error);
+       ret = box->v.sync_deinit(ctx, status_r);
+       if (ret < 0 && box->inbox &&
+           !box->storage->user->inbox_open_error_logged) {
+               errormsg = mail_storage_get_last_error(box->storage, &error);
                if (error == MAIL_ERROR_NOTPOSSIBLE) {
-                       storage->user->inbox_open_error_logged = TRUE;
+                       box->storage->user->inbox_open_error_logged = TRUE;
                        i_error("Syncing INBOX failed: %s", errormsg);
                }
        }