Skip to content

Commit

Permalink
redisxClear...Hooks() did not set call list to NULL.
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Jan 4, 2025
1 parent 983d9a7 commit fd212e0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/redisx-hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,14 @@ void redisxClearConnectHooks(Redis *redis) {
if(rConfigLock(redis) != X_SUCCESS) return;
p = (RedisPrivate *) redis->priv;
c = p->firstConnectCall;
p->firstConnectCall = NULL;

while(c != NULL) {
Hook *next = c->next;
free(c);
c = next;
}

rConfigUnlock(redis);
}

Expand Down Expand Up @@ -219,12 +221,15 @@ void redisxClearDisconnectHooks(Redis *redis) {
if(rConfigLock(redis) != X_SUCCESS) return;
p = (RedisPrivate *) redis->priv;
c = p->firstCleanupCall;
p->firstCleanupCall = NULL;

while(c != NULL) {
Hook *next = c->next;
free(c);
c = next;
}


rConfigUnlock(redis);
}

0 comments on commit fd212e0

Please sign in to comment.