Skip to content
Snippets Groups Projects
Commit 5b3441ae authored by Joshua Colp's avatar Joshua Colp
Browse files

Fix crash in res_pjsip_outbound_registration when the remote server can not be resolved.

This crash was caused by decrementing the reference count of a newly created message when
it should not be. This change fixes that but also fixes all other cases where this was
incorrectly done.

(closes issue ASTERISK-22188)
Reported by: Kinsey Moore


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396319 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 07d3705b
No related branches found
No related tags found
No related merge requests found
...@@ -250,7 +250,6 @@ static void create_send_notify(struct exten_state_subscription *exten_state_sub, ...@@ -250,7 +250,6 @@ static void create_send_notify(struct exten_state_subscription *exten_state_sub,
if (ast_sip_subscription_send_request(exten_state_sub->sip_sub, tdata) != PJ_SUCCESS) { if (ast_sip_subscription_send_request(exten_state_sub->sip_sub, tdata) != PJ_SUCCESS) {
ast_log(LOG_WARNING, "Unable to send NOTIFY request\n"); ast_log(LOG_WARNING, "Unable to send NOTIFY request\n");
pjsip_tx_data_dec_ref(tdata);
} }
} }
......
...@@ -484,7 +484,6 @@ static int msg_send(void *data) ...@@ -484,7 +484,6 @@ static int msg_send(void *data)
update_from(tdata, mdata->from); update_from(tdata, mdata->from);
vars_to_headers(mdata->msg, tdata); vars_to_headers(mdata->msg, tdata);
if (ast_sip_send_request(tdata, NULL, endpoint)) { if (ast_sip_send_request(tdata, NULL, endpoint)) {
pjsip_tx_data_dec_ref(tdata);
ast_log(LOG_ERROR, "SIP MESSAGE - Could not send request\n"); ast_log(LOG_ERROR, "SIP MESSAGE - Could not send request\n");
return -1; return -1;
} }
......
...@@ -440,7 +440,6 @@ static int notify_contact(void *obj, void *arg, int flags) ...@@ -440,7 +440,6 @@ static int notify_contact(void *obj, void *arg, int flags)
data->build_notify(tdata, data->info); data->build_notify(tdata, data->info);
if (ast_sip_send_request(tdata, NULL, data->endpoint)) { if (ast_sip_send_request(tdata, NULL, data->endpoint)) {
pjsip_tx_data_dec_ref(tdata);
ast_log(LOG_ERROR, "SIP NOTIFY - Unable to send request for " ast_log(LOG_ERROR, "SIP NOTIFY - Unable to send request for "
"contact %s\n", contact->uri); "contact %s\n", contact->uri);
return -1; return -1;
......
...@@ -221,7 +221,6 @@ static int handle_client_registration(void *data) ...@@ -221,7 +221,6 @@ static int handle_client_registration(void *data)
ao2_ref(client_state, +1); ao2_ref(client_state, +1);
if (pjsip_regc_send(client_state->client, tdata) != PJ_SUCCESS) { if (pjsip_regc_send(client_state->client, tdata) != PJ_SUCCESS) {
ao2_ref(client_state, -1); ao2_ref(client_state, -1);
pjsip_tx_data_dec_ref(tdata);
} }
return 0; return 0;
......
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