Skip to content

Commit

Permalink
Add debug assert on duplicate freeClientAsync (#896)
Browse files Browse the repository at this point in the history
When debug assert mode enabled, verify that we don't insert the same
client twice into server.clients_to_close.

Signed-off-by: naglera <[email protected]>
  • Loading branch information
naglera authored and madolson committed Sep 2, 2024
1 parent 9dbc35c commit 914abb0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,7 @@ void freeClient(client *c) {
void freeClientAsync(client *c) {
if (c->flag.close_asap || c->flag.script) return;
c->flag.close_asap = 1;
debugServerAssertWithInfo(c, NULL, listSearchKey(server.clients_to_close, c) == NULL);
listAddNodeTail(server.clients_to_close, c);
}

Expand Down

0 comments on commit 914abb0

Please sign in to comment.