summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hiredis.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hiredis.c b/hiredis.c
index 0658e34..c461131 100644
--- a/hiredis.c
+++ b/hiredis.c
@@ -708,6 +708,11 @@ int redisReconnect(redisContext *c) {
c->err = 0;
memset(c->errstr, '\0', strlen(c->errstr));
+ if (c->privdata && c->funcs->free_privdata) {
+ c->funcs->free_privdata(c->privdata);
+ c->privdata = NULL;
+ }
+
redisNetClose(c);
sdsfree(c->obuf);