[Asterisk-code-review] res pjsip session: segfault on already disconnected session (asterisk[13])

George Joseph asteriskteam at digium.com
Thu Sep 1 11:27:44 CDT 2016


George Joseph has posted comments on this change.

Change subject: res_pjsip_session: segfault on already disconnected session
......................................................................


Patch Set 8: Code-Review-1

(1 comment)

https://gerrit.asterisk.org/#/c/3514/8/res/res_pjsip_session.c
File res/res_pjsip_session.c:

PS8, Line 2102: #ifdef HAVE_PJSIP_INV_SESSION_REF
              : 	if (pjsip_inv_add_ref(invite->session->inv_session) != PJ_SUCCESS) {
              : 		ast_log(LOG_ERROR, "Can't increase the session reference counter\n");
              : 		return -1;
              : 	}
              : #endif
Looking more at how new_invite it called, it might make better sense to move this call to just before you push the task.  That's normally how we do it when dealing with plain ao2 objects.  The caller bumps the ref count before pushing the task to insure that the object doesn't go away while the task is waiting.  Then the task decrements the reference when it's done (as you do below).


-- 
To view, visit https://gerrit.asterisk.org/3514
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4d28b1fb3b91f0492a911d110049d670fdc3c8d7
Gerrit-PatchSet: 8
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list