]> 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 14:39:38 +0000 (07:39 -0700)
commita780386dbb975c9874e51cc87118e762e1f343c5
treec0d5f864c1077138cd2e5f704985af255b61f53e
parent4f166b90178d8fe6ec0feed70c7492fea87b9ea1
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