From 3c023ee1572fb4dcbbc526b9c64cf3bc315464db Mon Sep 17 00:00:00 2001 From: Matt Stancliff Date: Thu, 22 Jan 2015 15:23:41 -0500 Subject: Cleanup memory during test --- test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } -- cgit v1.2.3