Skip to content
Snippets Groups Projects
Commit 5247ba4b authored by Corey Farrell's avatar Corey Farrell
Browse files

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
parent 637b37fb
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment