]> git.ipfire.org Git - thirdparty/freeswitch.git/commit
Help the static analyzer in `handle_ice`
authorTravis Cross <tc@traviscross.com>
Fri, 22 Aug 2014 03:30:32 +0000 (03:30 +0000)
committerTravis Cross <tc@traviscross.com>
Fri, 22 Aug 2014 03:37:42 +0000 (03:37 +0000)
commitaa1a05d0aa2b13632b10d5e8cce78794288c8295
tree48e763a155a4016a9f4efc7874838051b315d12e
parent3c32dd3bc92ccbcac538a25746f09ca68371319b
Help the static analyzer in `handle_ice`

Clang's static analyzer thinks we could be using `hosts` here when it
is NULL.  We probably weren't, but it's easy to see how it could think
so.  We were checking whether `from_addr` matched `ice->addr` three
times, and between the second on third time we might have modified the
`ice->addr`; however we only get there if it matched the second time,
so we could only make it not match at that point and avoid the third
branch.  We can't make it match where it did not before.

We'll simplify the logic a bit here so static analyzers (and humans)
can hopefully see this more readily.
src/switch_rtp.c