]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
replicator: Fix crash when removing user from queue and debug logging is enabled
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 1 Nov 2022 09:23:44 +0000 (11:23 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 2 Nov 2022 09:00:00 +0000 (09:00 +0000)
Broken by 4b5337667cea6dea3d684540ee79f26292f9b42d

src/replication/replicator/replicator-queue.c

index 45ccf000fa41aef86d97c0c83a2ed0913cccf550..17c76fbcc8e0af337a927a6b3f29cf7040dddc5b 100644 (file)
@@ -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)