Merge pull request #347 from dragos-oancea/switch_ivr_async-status-val-never-read

[core] scan-build: Value stored to 'status' is never read - switch_ivr_eavesdrop_session()
This commit is contained in:
Andrey Volk 2020-02-16 02:07:37 +04:00 committed by GitHub
commit 10aad69e1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 8 deletions

View File

@ -2182,8 +2182,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session
const char *group_name = switch_channel_get_variable(tchannel, "eavesdrop_group"); const char *group_name = switch_channel_get_variable(tchannel, "eavesdrop_group");
/* If we don't have a group, then return */ /* If we don't have a group, then return */
if (!group_name) { if (!group_name) {
status = SWITCH_STATUS_BREAK; switch_goto_status(SWITCH_STATUS_BREAK, end);
goto end;
} }
/* Separate the group */ /* Separate the group */
data = strdup(group_name); data = strdup(group_name);
@ -2198,8 +2197,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session
switch_safe_free(data); switch_safe_free(data);
/* If we didn't find any match, then end */ /* If we didn't find any match, then end */
if (!ok) { if (!ok) {
status = SWITCH_STATUS_BREAK; switch_goto_status(SWITCH_STATUS_BREAK, end);
goto end;
} }
} }
@ -2224,7 +2222,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
NULL, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { NULL, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cannot init codec\n"); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cannot init codec\n");
switch_core_session_rwunlock(tsession);
goto end; goto end;
} }
@ -2584,8 +2581,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session
msg.message_id = SWITCH_MESSAGE_INDICATE_UNBRIDGE; msg.message_id = SWITCH_MESSAGE_INDICATE_UNBRIDGE;
switch_core_session_receive_message(session, &msg); switch_core_session_receive_message(session, &msg);
status = SWITCH_STATUS_SUCCESS;
end: end:
if (codec_initialized) if (codec_initialized)
@ -2610,7 +2606,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session
} }
switch_core_session_rwunlock(tsession); switch_core_session_rwunlock(tsession);
status = SWITCH_STATUS_SUCCESS;
switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE); switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE);
} }