Skip to content

Commit

Permalink
Update src/networking.c
Browse files Browse the repository at this point in the history
Signed-off-by: Uri Yagelnik <[email protected]>
  • Loading branch information
uriyage committed Dec 16, 2024
1 parent ff1b620 commit b4755cb
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -1610,10 +1610,7 @@ void clearClientConnectionState(client *c) {
clientSetDefaultAuth(c);
moduleNotifyUserChanged(c);
discardTransaction(c);

if (c->pubsub_data) {
freeClientPubSubData(c);
}
freeClientPubSubData(c);

if (c->name) {
decrRefCount(c->name);
Expand Down Expand Up @@ -1652,10 +1649,7 @@ void freeClient(client *c) {

/* Notify module system that this client auth status changed. */
moduleNotifyUserChanged(c);

if (c->module_data) {
freeClientModuleData(c);
}
freeClientModuleData(c);

/* If this client was scheduled for async freeing we need to remove it
* from the queue. Note that we need to do this here, because later
Expand Down Expand Up @@ -1703,9 +1697,8 @@ void freeClient(client *c) {
c->duration = 0;
if (c->flag.blocked) unblockClient(c, 1);

if (c->bstate) freeClientBlockingState(c);

if (c->pubsub_data) freeClientPubSubData(c);
freeClientBlockingState(c);
freeClientPubSubData(c);

/* Free data structures. */
listRelease(c->reply);
Expand All @@ -1730,7 +1723,7 @@ void freeClient(client *c) {
* places where active clients may be referenced. */
unlinkClient(c);

if (c->repl_data) freeClientReplicationData(c);
freeClientReplicationData(c);

/* Remove client from memory usage buckets */
if (c->mem_usage_bucket) {
Expand All @@ -1743,7 +1736,7 @@ void freeClient(client *c) {
if (c->name) decrRefCount(c->name);
if (c->lib_name) decrRefCount(c->lib_name);
if (c->lib_ver) decrRefCount(c->lib_ver);
if (c->mstate) freeClientMultiState(c);
freeClientMultiState(c);
sdsfree(c->peerid);
sdsfree(c->sockname);
zfree(c);
Expand Down

0 comments on commit b4755cb

Please sign in to comment.