Commit b60952f2 authored by Pieter Noordhuis's avatar Pieter Noordhuis
Browse files

Disconnect before free'ing

parent 9cd3b03d
......@@ -594,6 +594,11 @@ void redisDisconnect(redisContext *c) {
}
void redisFree(redisContext *c) {
/* Disconnect before free'ing if not yet disconnected. */
if (c->flags & REDIS_CONNECTED)
redisDisconnect(c);
/* Fire free callback and clear all allocations. */
if (c->cbFree != NULL)
c->cbFree(c,c->privdataFree);
if (c->error != NULL)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment