diff options
author | Henri Doreau <henri.doreau@cea.fr> | 2013-01-22 10:16:30 +0100 |
---|---|---|
committer | Henri Doreau <henri.doreau@cea.fr> | 2013-01-22 10:19:46 +0100 |
commit | 814be4f5bd62b4f66281879b3035a20ad84bb498 (patch) | |
tree | 4e23740ab761af60b4b21fafe33904d308d2089d /test.c | |
parent | 3c46b13a62164d9f3f99289476f84db7918aafc2 (diff) |
Made connect functions return NULL on alloc failures.
Updated documentation and examples accordingly.
Diffstat (limited to 'test.c')
-rw-r--r-- | test.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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); } |