diff --git a/src/modules/db_redis/redis_connection.c b/src/modules/db_redis/redis_connection.c index 1166117961c..5cf36ffb369 100644 --- a/src/modules/db_redis/redis_connection.c +++ b/src/modules/db_redis/redis_connection.c @@ -124,6 +124,11 @@ int db_redis_connect(km_redis_con_t *con) { #endif reply = NULL; + if(con->con) { + LM_DBG("free old connection first\n"); + redisFree(con->con); + } + // TODO: introduce require_master mod-param and check if we're indeed master // TODO: on carrier, if we have db fail-over, the currently connected // redis server will become slave without dropping connections?