summaryrefslogtreecommitdiff
path: root/test.c
diff options
context:
space:
mode:
authorHenri Doreau <henri.doreau@cea.fr>2013-01-22 10:16:30 +0100
committerHenri Doreau <henri.doreau@cea.fr>2013-01-22 10:19:46 +0100
commit814be4f5bd62b4f66281879b3035a20ad84bb498 (patch)
tree4e23740ab761af60b4b21fafe33904d308d2089d /test.c
parent3c46b13a62164d9f3f99289476f84db7918aafc2 (diff)
Made connect functions return NULL on alloc failures.
Updated documentation and examples accordingly.
Diffstat (limited to 'test.c')
-rw-r--r--test.c5
1 files changed, 4 insertions, 1 deletions
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);
}