From d7724cc2aad638e376574e53a72f09813579d145 Mon Sep 17 00:00:00 2001 From: William King Date: Wed, 9 Sep 2015 10:39:00 -0700 Subject: [PATCH] FS-8075 Fix for failover when you pull power on redis, while redis clients under load test --- src/mod/applications/mod_hiredis/hiredis_profile.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mod/applications/mod_hiredis/hiredis_profile.c b/src/mod/applications/mod_hiredis/hiredis_profile.c index f83f5cf55f..ab2d152e0c 100644 --- a/src/mod/applications/mod_hiredis/hiredis_profile.c +++ b/src/mod/applications/mod_hiredis/hiredis_profile.c @@ -143,6 +143,11 @@ switch_status_t hiredis_profile_execute_sync(hiredis_profile_t *profile, const c response = redisCommand(profile->conn->context, data); + if ( !response ) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "hiredis: empty response received\n"); + return SWITCH_STATUS_GENERR; + } + switch(response->type) { case REDIS_REPLY_STATUS: /* fallthrough */ case REDIS_REPLY_STRING: