From: Timo Sirainen Date: Tue, 1 Nov 2022 09:23:44 +0000 (+0200) Subject: replicator: Fix crash when removing user from queue and debug logging is enabled X-Git-Tag: 2.4.0~3462 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa41ca5f69b8efb389530b801892bef084d09bdd;p=thirdparty%2Fdovecot%2Fcore.git replicator: Fix crash when removing user from queue and debug logging is enabled Broken by 4b5337667cea6dea3d684540ee79f26292f9b42d --- diff --git a/src/replication/replicator/replicator-queue.c b/src/replication/replicator/replicator-queue.c index 45ccf000fa..17c76fbcc8 100644 --- a/src/replication/replicator/replicator-queue.c +++ b/src/replication/replicator/replicator-queue.c @@ -251,13 +251,13 @@ void replicator_queue_remove(struct replicator_queue *queue, if (!user->popped) priorityq_remove(queue->user_queue, &user->item); hash_table_remove(queue->user_hash, user->username); - replicator_user_unref(&user); if (queue->change_callback != NULL) { e_debug(queue->event, "user %s: Queue changed - calling callback", user->username); queue->change_callback(queue->change_context); } + replicator_user_unref(&user); } unsigned int replicator_queue_count(struct replicator_queue *queue)