]> git.ipfire.org Git - thirdparty/asterisk.git/commit
AST-2017-011 - res_pjsip_session: session leak when a call is rejected
authorKevin Harwell <kharwell@digium.com>
Thu, 19 Oct 2017 18:35:16 +0000 (13:35 -0500)
committerGeorge Joseph <gjoseph@digium.com>
Wed, 8 Nov 2017 12:49:59 +0000 (05:49 -0700)
commitdd1a914495438161bf9e2fdebffceaec94d5907b
treeacf4568aadf862ad5187687d6622ceda5faca040
parentb7f64c30e23392b5191b36fa6e16b18f575bf121
AST-2017-011 - res_pjsip_session: session leak when a call is rejected

A previous commit made it so when an invite session transitioned into a
disconnected state destruction of the Asterisk pjsip session object was
postponed until either a transport error occurred or the event timer
expired. However, if a call was rejected (for instance a 488) before the
session was fully established the event timer may not have been initiated,
or it was canceled without triggering either of the session finalizing states
mentioned above.

Really the only time destruction of the session should be delayed is when a
BYE is being transacted. This is because it's possible in some cases for the
session to be disconnected, but the BYE is still transacting.

This patch makes it so the session object always gets released (no more
memory leak) when the pjsip session is in a disconnected state. Except when
the method is a BYE. Then it waits until a transport error occurs or an event
timeout.

ASTERISK-27345 #close

Reported by: Corey Farrell

Change-Id: I1e724737b758c20ac76d19d3611e3d2876ae10ed
res/res_pjsip_session.c