summaryrefslogtreecommitdiff
path: root/hiredis.c
diff options
context:
space:
mode:
Diffstat (limited to 'hiredis.c')
-rw-r--r--hiredis.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hiredis.c b/hiredis.c
index d4cad7c..970b45a 100644
--- a/hiredis.c
+++ b/hiredis.c
@@ -809,8 +809,7 @@ static redisContext *redisContextInit() {
}
void redisFree(redisContext *c) {
- /* Disconnect before free'ing if not yet disconnected. */
- if (c->flags & REDIS_CONNECTED)
+ if (c->fd > 0)
close(c->fd);
if (c->errstr != NULL)
sdsfree(c->errstr);