mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 03:50:31 +00:00
res_ari_events: Fix use after free / double-free of JSON message.
When stasis_app_message_handler needs to queue a message for a later connection it needs to bump the message reference so it doesn't get freed when the caller releases it's reference. Change-Id: I82696df8fe723b3365c15c3f7089501da8daa892
This commit is contained in:
@@ -108,7 +108,9 @@ static void stasis_app_message_handler(
|
||||
msg_application);
|
||||
} else if (!session->ws_session) {
|
||||
/* 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,
|
||||
"Queued '%s' message for Stasis app '%s'; websocket is not ready\n",
|
||||
msg_type,
|
||||
|
Reference in New Issue
Block a user