diff options
-rw-r--r-- | hiredis.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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; } |