[Core] Fix possible memory leak of switch_core_session_message_t in switch_core_session_queue_indication()

This commit is contained in:
Andrey Volk 2021-01-22 21:57:24 +03:00
parent d127eeeecc
commit 97930570dc

View File

@ -1026,8 +1026,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_queue_indication(switch_core
msg->message_id = indication;
msg->from = __FILE__;
switch_set_flag(msg, SCSMF_DYNAMIC);
switch_core_session_queue_message(session, msg);
return SWITCH_STATUS_SUCCESS;
if (switch_core_session_queue_message(session, msg) == SWITCH_STATUS_SUCCESS) {
return SWITCH_STATUS_SUCCESS;
}
free(msg);
}
return SWITCH_STATUS_FALSE;