[Asterisk-code-review] res_pjsip: prevent crash on websocket disconnect (asterisk[18])

George Joseph asteriskteam at digium.com
Mon Oct 17 08:48:33 CDT 2022


Attention is currently required from: Michael Bradeen.

George Joseph has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/19413 )

Change subject: res_pjsip: prevent crash on websocket disconnect
......................................................................


Patch Set 1: Code-Review-1

(2 comments)

File res/res_pjsip.c:

https://gerrit.asterisk.org/c/asterisk/+/19413/comment/260b4219_5ee23623 
PS1, Line 2288: 		clean_contact_from_tdata(tdata);
I don't think this is a good idea. There's no way to know whether ast_sip_create_response was even called.  It should be up to the caller to clean up resources if they get an error response code.

Same for the cleanups below.

In general I think cleaning up things you didn't allocate/lock/refcount isn't a good idea.


https://gerrit.asterisk.org/c/asterisk/+/19413/comment/675f0e17_eba9571b 
PS1, Line 2317: 	pj_grp_lock_dec_ref(tsx_glock);
I'm not quite understanding.  If you decrement the lock here what was the whole point?  Is something happening while this function is being called?  Is that the "qualify" thread?



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19413
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: Id050fded2247a04d8f0fc5b8a2cf3e5482cb8cee
Gerrit-Change-Number: 19413
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Bradeen <mbradeen at sangoma.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Attention: Michael Bradeen <mbradeen at sangoma.com>
Gerrit-Comment-Date: Mon, 17 Oct 2022 13:48:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221017/0714f85b/attachment.html>


More information about the asterisk-code-review mailing list