summaryrefslogtreecommitdiff
path: root/hiredis.c
diff options
context:
space:
mode:
Diffstat (limited to 'hiredis.c')
-rw-r--r--hiredis.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hiredis.c b/hiredis.c
index efe2543..d93b38f 100644
--- a/hiredis.c
+++ b/hiredis.c
@@ -528,7 +528,12 @@ static int processItem(redisReader *r) {
}
redisReader *redisReplyReaderCreate(void) {
- redisReader *r = calloc(sizeof(redisReader),1);
+ redisReader *r;
+
+ r = calloc(sizeof(redisReader),1);
+ if (r == NULL)
+ return NULL;
+
r->err = 0;
r->errstr[0] = '\0';
r->fn = &defaultFunctions;