]> 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:40 +0000 (05:49 -0700)
commit93e6dd60bb5dd87f2aa05c9260fb50c6fbefd69d
tree1b5c793f5e1ee98e2fdf01dc7aa364eb9c64115f
parentfbaca8d545df7304fcd1373179f7e00502d8f521
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