From: Timo Sirainen Date: Fri, 3 Feb 2017 14:16:26 +0000 (+0200) Subject: lib-storage: Once hooks have run, set vlast to NULL to make sure it's not used X-Git-Tag: 2.3.0.rc1~2195 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f32382d2da479a4371e08c443679528db37ea988;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Once hooks have run, set vlast to NULL to make sure it's not used The functions can't be correctly overridden outside their own specific hooks. It would work only if hook_build_update() is called afterwards and currently there's no public API for that. --- diff --git a/src/lib-storage/mail-storage-hooks.c b/src/lib-storage/mail-storage-hooks.c index 282eb3def0..1889eb7222 100644 --- a/src/lib-storage/mail-storage-hooks.c +++ b/src/lib-storage/mail-storage-hooks.c @@ -273,6 +273,7 @@ void hook_mail_user_created(struct mail_user *user) hook_build_update(ctx, user->vlast); } T_END; } + user->vlast = NULL; pool_unref(&ctx->pool); } @@ -326,6 +327,7 @@ void hook_mail_storage_created(struct mail_storage *storage) hook_build_update(ctx, storage->vlast); } T_END; } + storage->vlast = NULL; pool_unref(&ctx->pool); } @@ -342,6 +344,7 @@ void hook_mailbox_list_created(struct mailbox_list *list) hook_build_update(ctx, list->vlast); } T_END; } + list->vlast = NULL; pool_unref(&ctx->pool); } @@ -358,6 +361,7 @@ void hook_mailbox_allocated(struct mailbox *box) hook_build_update(ctx, box->vlast); } T_END; } + box->vlast = NULL; pool_unref(&ctx->pool); } @@ -386,5 +390,6 @@ void hook_mail_allocated(struct mail *mail) hook_build_update(ctx, pmail->vlast); } T_END; } + pmail->vlast = NULL; pool_unref(&ctx->pool); }