Skip to content

Commit

Permalink
Add debug assert on freeClientAsync
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 committed Aug 12, 2024
1 parent 5166d48 commit 3dafbaf
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 3dafbaf

Please sign in to comment.