Merge "res_ari_events: Fix use after free / double-free of JSON message."

This commit is contained in:
Jenkins2
2017-11-07 16:10:11 -06:00
committed by Gerrit Code Review

View File

@@ -108,7 +108,9 @@ static void stasis_app_message_handler(
msg_application); msg_application);
} else if (!session->ws_session) { } else if (!session->ws_session) {
/* If the websocket is NULL, the message goes to the queue */ /* If the websocket is NULL, the message goes to the queue */
AST_VECTOR_APPEND(&session->message_queue, message); if (!AST_VECTOR_APPEND(&session->message_queue, message)) {
ast_json_ref(message);
}
ast_log(LOG_WARNING, ast_log(LOG_WARNING,
"Queued '%s' message for Stasis app '%s'; websocket is not ready\n", "Queued '%s' message for Stasis app '%s'; websocket is not ready\n",
msg_type, msg_type,