"vscode:/vscode.git/clone" did not exist on "37f682dd704e933eb74aa052b5e161c2a443f051"
Commit d1e820d8 authored by NanXiao's avatar NanXiao Committed by Matt Stancliff
Browse files

Add error check in redisContextInit

Check whether the obuf or reader is empty: if one of the items is empty,
free the redisContext.
parent b6a86079
......@@ -1059,6 +1059,12 @@ static redisContext *redisContextInit(void) {
c->errstr[0] = '\0';
c->obuf = sdsempty();
c->reader = redisReaderCreate();
if (c->obuf == NULL || c->reader == NULL) {
redisFree(c);
return NULL;
}
return c;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment