From: Timo Sirainen Date: Tue, 16 Mar 2021 12:36:35 +0000 (+0200) Subject: login-common: Track referenced but destroyed clients in a linked list X-Git-Tag: 2.3.15~212 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c622cdbe08df2f642e28923c39894516143ae2a;p=thirdparty%2Fdovecot%2Fcore.git login-common: Track referenced but destroyed clients in a linked list This helps debugging. --- diff --git a/src/login-common/client-common.c b/src/login-common/client-common.c index 65ce12766b..bedfa26d48 100644 --- a/src/login-common/client-common.c +++ b/src/login-common/client-common.c @@ -31,6 +31,7 @@ #include "client-common.h" struct client *clients = NULL; +struct client *destroyed_clients = NULL; static struct client *last_client = NULL; static unsigned int clients_count = 0; @@ -309,6 +310,7 @@ void client_destroy(struct client *client, const char *reason) /* remove from clients linked list before it's added to client_fd_proxies. */ DLLIST_REMOVE(&clients, client); + DLLIST_PREPEND(&destroyed_clients, client); client_disconnect(client, reason, !client->login_success); @@ -413,6 +415,7 @@ bool client_unref(struct client **_client) i_close_fd(&client->fd); event_unref(&client->event); + DLLIST_REMOVE(&destroyed_clients, client); i_free(client->proxy_user); i_free(client->proxy_master_user); i_free(client->virtual_user);