[tor-bugs] #20629 [Core Tor/Tor]: hs: Fix issues found by coverity
Tor Bug Tracker & Wiki
blackhole at torproject.org
Fri Nov 11 16:17:31 UTC 2016
#20629: hs: Fix issues found by coverity
-----------------------------+------------------------------------
Reporter: dgoulet | Owner: dgoulet
Type: defect | Status: merge_ready
Priority: Medium | Milestone: Tor: 0.3.0.x-final
Component: Core Tor/Tor | Version:
Severity: Normal | Resolution:
Keywords: tor-hs, prop224 | Actual Points:
Parent ID: | Points: 0.1
Reviewer: | Sponsor: SponsorR-must
-----------------------------+------------------------------------
Comment (by dgoulet):
Replying to [comment:2 nickm]:
> > Is this about the fact that if tt_str_op() is triggered, we go to the
done: label and then it leaks? I would be surprised as we often do that in
test that is we assert and then we free.
>
> Actually, we have to fix that ''all the time'' :)
Big problem with this approach is that we can't scope our variables in
`{}` which we do heavily at least in the HS tests. So we should make all
of them global to the function and just free all of it in `done:`? If so,
I can open a ticket just for that pass on the test.
>
> Coverity will complain if there is any path where the memory is
allocated but not freed.
I'm surprised that Coverity doesn't find _more_ of those as there are a
lot.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/20629#comment:3>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list