summaryrefslogtreecommitdiff
path: root/test.c
diff options
context:
space:
mode:
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);
}