From 814be4f5bd62b4f66281879b3035a20ad84bb498 Mon Sep 17 00:00:00 2001 From: Henri Doreau Date: Tue, 22 Jan 2013 10:16:30 +0100 Subject: Made connect functions return NULL on alloc failures. Updated documentation and examples accordingly. --- test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test.c') diff --git a/test.c b/test.c index 737ad1c..6786003 100644 --- a/test.c +++ b/test.c @@ -88,7 +88,10 @@ static redisContext *connect(struct config config) { assert(NULL); } - if (c->err) { + if (c == NULL) { + printf("Connection error: can't allocate redis context\n"); + exit(1); + } else if (c->err) { printf("Connection error: %s\n", c->errstr); exit(1); } -- cgit v1.2.3