[tor-bugs] #20629 [Core Tor/Tor]: hs: Fix issues found by coverity

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Nov 10 17:39:28 UTC 2016


#20629: hs: Fix issues found by coverity
-------------------------------+--------------------------------
     Reporter:  dgoulet        |      Owner:  dgoulet
         Type:  defect         |     Status:  new
     Priority:  Medium         |  Milestone:  Tor: 0.3.0.x-final
    Component:  Core Tor/Tor   |    Version:
     Severity:  Normal         |   Keywords:  tor-hs, prop224
Actual Points:                 |  Parent ID:
       Points:  0.1            |   Reviewer:
      Sponsor:  SponsorR-must  |
-------------------------------+--------------------------------
 They've been mostly already fixed except on in the branch attached to this
 ticket.

 However, that one is a mystery to me, in `test_hs_descriptor.c`:

 {{{
 206               char *addr1 = tor_addr_to_str_dup(&ls1->u.ap.addr),
 207                    *addr2 = tor_addr_to_str_dup(&ls2->u.ap.addr);
 >>>     CID 1375997:  Resource leaks  (RESOURCE_LEAK)
 >>>     Variable "addr1" going out of scope leaks the storage it points
 to.
 208               tt_str_op(addr1, OP_EQ, addr2);
 209               tor_free(addr1);
 210               tor_free(addr2);
 }}}

 (Same goes for addr2)

 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.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/20629>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list