]> git.ipfire.org Git - thirdparty/asterisk.git/commit
AST-2018-005: Fix tdata leaks when calling pjsip_endpt_send_response(2)
authorGeorge Joseph <gjoseph@digium.com>
Tue, 6 Feb 2018 17:28:49 +0000 (10:28 -0700)
committerGeorge Joseph <gjoseph@digium.com>
Wed, 21 Feb 2018 15:11:19 +0000 (08:11 -0700)
commitbfa7b200405d20077fa352d90120d603148ca509
treea7b0bf87f61ac9d76ebe603f763737c704a3fee8
parent8e170f5f186a1be3965c8636c5f01736e4bcc51c
AST-2018-005: Fix tdata leaks when calling pjsip_endpt_send_response(2)

pjsip_distributor:
   authenticate() creates a tdata and uses it to send a challenge or
   failure response.  When pjsip_endpt_send_response2() succeeds, it
   automatically decrements the tdata ref count but when it fails, it
   doesn't.  Since we weren't checking for a return status, we weren't
   decrementing the count ourselves on error and were therefore leaking
   tdatas.

res_pjsip_session:
   session_reinvite_on_rx_request wasn't decrementing the ref count
   if an error happened while sending a 491 response.
   pre_session_setup wasn't decrementing the ref count if
   while sending an error after a pjsip_inv_verify_request failure.

res_pjsip:
   ast_sip_send_response wasn't decrementing the ref count on error.

ASTERISK-27618
Reported By: Sandro Gauci

Change-Id: Iab33a6c7b6fba96148ed465b690ba8534ac961bf
res/res_pjsip.c
res/res_pjsip/pjsip_distributor.c
res/res_pjsip_session.c