[Asterisk-code-review] pjsip distributor.c: Fix off-nominal tdata ref leak. (asterisk[13])

Mark Michelson asteriskteam at digium.com
Tue Feb 14 12:58:46 CST 2017


Mark Michelson has posted comments on this change. ( https://gerrit.asterisk.org/4924 )

Change subject: pjsip_distributor.c: Fix off-nominal tdata ref leak.
......................................................................


Patch Set 1:

> > So, it's a theoretical?
 > >
 > > The return value should match an enum, if not then they are
 > > violating the contract.
 > 
 > Should still code for that path.  This patch make sure and we won't
 > wind up with dead code to satisfy the compiler.

I don't understand this. Asterisk developers code with -Wall (which includes -Wswitch) and -Werror. This means that if there is an enumeration case that is not present in a switch statement, or if there is a case that is outside the range of the enumeration you are switching on, the compiler will throw a warning, which will then be promoted to an error.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I571f371d0956a8039b197b4dbd8af6b18843598d
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: No



More information about the asterisk-code-review mailing list