Modules: fix thread safe context creation crash.

See #6525, this likely creates a NULL deference if the client was
terminated by Redis between the creation of the blocked client and the
creation of the thread safe context.
This commit is contained in:
antirez 2019-10-31 18:07:33 +01:00
parent 1ee195d255
commit fdaea2a7a7

View File

@ -4463,7 +4463,7 @@ RedisModuleCtx *RM_GetThreadSafeContext(RedisModuleBlockedClient *bc) {
ctx->client = createClient(NULL);
if (bc) {
selectDb(ctx->client,bc->dbid);
ctx->client->id = bc->client->id;
if (bc->client) ctx->client->id = bc->client->id;
}
return ctx;
}