From: Chris Rienzo Date: Mon, 23 Jan 2017 20:37:13 +0000 (-0500) Subject: FS-9965 [mod_hiredis] release context after getting alternate connection X-Git-Tag: v1.8.0~896 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99e60c290af777956fe5486793a5690b35662cb7;p=thirdparty%2Ffreeswitch.git FS-9965 [mod_hiredis] release context after getting alternate connection --- diff --git a/src/mod/applications/mod_hiredis/hiredis_profile.c b/src/mod/applications/mod_hiredis/hiredis_profile.c index b6b548e1ce..f108e1ac75 100644 --- a/src/mod/applications/mod_hiredis/hiredis_profile.c +++ b/src/mod/applications/mod_hiredis/hiredis_profile.c @@ -344,8 +344,9 @@ switch_status_t hiredis_profile_execute_requests(hiredis_profile_t *profile, swi /* have a bad connection, try a single reconnect attempt before moving on to alternate connection */ if (reconnected || hiredis_context_reconnect(context) != SWITCH_STATUS_SUCCESS) { /* try alternate connection */ + hiredis_context_t *new_context = hiredis_profile_get_context(profile, context->connection, session); hiredis_context_release(context, session); - context = hiredis_profile_get_context(profile, context->connection, session); + context = new_context; if (context) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "hiredis: got alternate connection to [%s, %d]\n", context->connection->host, context->connection->port); } else {