]> 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:47:35 +0000 (05:47 -0700)
commit1b31e3c3bd6cf18d6f4a4dbfc2f8c2b28ba6f71c
treea8baf0c3f29c32f5d19d4737b4f5525ff5709d6f
parent1ee2ce8c703dd763d1779a877099640bb5cd46d0
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