Skip to content

Commit

Permalink
free failed-connection context if redisAsyncConnect() returns one
Browse files Browse the repository at this point in the history
  • Loading branch information
sflow committed Jun 1, 2023
1 parent 1696a0f commit 2f795bb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Linux/mod_sonic.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,10 @@ extern "C" {
}
char *errm = ctx ? ctx->errstr : "ctx=NULL";
myDebug(1, "sonic db_connectClient failed (fd=%d) err=%s", fd, errm);
// No more cleanup required here (calling redisAsyncFree(ctx) triggers SIGSEGV)
if(ctx) {
myDebug(1, "Connection failed but context still returned - calling redisAsyncFree(ctx)");
redisAsyncFree(ctx);
}
return NO;
}

Expand Down

0 comments on commit 2f795bb

Please sign in to comment.