[Asterisk-code-review] res_pjsip: Fix transport_states ref leak (...asterisk[16])

Sean Bright asteriskteam at digium.com
Wed Apr 10 08:18:42 CDT 2019


Sean Bright has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/11252 )

Change subject: res_pjsip: Fix transport_states ref leak
......................................................................


Patch Set 1:

(1 comment)

https://gerrit.asterisk.org/#/c/11252/1/res/res_pjsip/pjsip_message_filter.c 
File res/res_pjsip/pjsip_message_filter.c:

https://gerrit.asterisk.org/#/c/11252/1/res/res_pjsip/pjsip_message_filter.c@114 
PS1, Line 114: transport_state
Feel free to ignore all of this:

While you're in here... `transport_state` will never be NULL, so this check can be removed.

This `if` statement could be negated:

 if (transport_state->type == AST_TRANSPORT_UDP
    && !pj_strcmp(&transport_state->transport->local_name.host, address)
    && transport_state->transport->local_name.port == port) {

And you could move the `sip_transport` assignment into the block which would simplify a little.



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

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I40e35b5a339121300c80075c30db47201a6c374e
Gerrit-Change-Number: 11252
Gerrit-PatchSet: 1
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-Comment-Date: Wed, 10 Apr 2019 13:18:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190410/4405c93e/attachment.html>


More information about the asterisk-code-review mailing list