summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/test.c b/test.c
index b4d61ad..f1566fb 100644
--- a/test.c
+++ b/test.c
@@ -107,6 +107,7 @@ static redisContext *connect(struct config config) {
exit(1);
} else if (c->err) {
printf("Connection error: %s\n", c->errstr);
+ redisFree(c);
exit(1);
}
@@ -497,6 +498,7 @@ static void test_invalid_timeout_errors(struct config config) {
c = redisConnectWithTimeout(config.tcp.host, config.tcp.port, config.tcp.timeout);
test_cond(c->err == REDIS_ERR_IO);
+ redisFree(c);
test("Set error when an invalid timeout sec value is given to redisConnectWithTimeout: ");
@@ -506,7 +508,6 @@ static void test_invalid_timeout_errors(struct config config) {
c = redisConnectWithTimeout(config.tcp.host, config.tcp.port, config.tcp.timeout);
test_cond(c->err == REDIS_ERR_IO);
-
redisFree(c);
}