[tor-bugs] #18673 [Tor]: Memory leak with TestingEnableCellStatsEvent

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Mar 28 23:15:37 UTC 2016


#18673: Memory leak with TestingEnableCellStatsEvent
--------------------+------------------------------------
 Reporter:  nickm   |          Owner:
     Type:  defect  |         Status:  reopened
 Priority:  Medium  |      Milestone:  Tor: 0.2.8.x-final
Component:  Tor     |        Version:
 Severity:  Normal  |     Resolution:
 Keywords:          |  Actual Points:
Parent ID:          |         Points:  small
 Reviewer:          |        Sponsor:  SponsorS-can
--------------------+------------------------------------
Changes (by yawning):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 This breaks unit tests, and possibly lots of other things with a null
 pointer deref.

 {{{
 diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
 index 670c5b3..1efb7ef 100644
 --- a/src/or/circuitlist.c
 +++ b/src/or/circuitlist.c
 @@ -760,7 +760,7 @@ or_circuit_new(circid_t p_circ_id, channel_t *p_chan)
  void
  circuit_clear_testing_cell_stats(circuit_t *circ)
  {
 -  if (!circ)
 +  if (!circ || !circ->testing_cell_stats)
      return;
    SMARTLIST_FOREACH(circ->testing_cell_stats, testing_cell_stats_entry_t
 *,
                      ent, tor_free(ent));
 }}}

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


More information about the tor-bugs mailing list