[tor-bugs] #20938 [Core Tor/Tor]: Test: memory leak in single onion service test

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Dec 10 14:31:44 UTC 2016


#20938: Test: memory leak in single onion service test
--------------------------+------------------------------------
 Reporter:  dgoulet       |          Owner:
     Type:  defect        |         Status:  needs_revision
 Priority:  Medium        |      Milestone:  Tor: 0.2.9.x-final
Component:  Core Tor/Tor  |        Version:
 Severity:  Normal        |     Resolution:
 Keywords:  test          |  Actual Points:
Parent ID:                |         Points:  0.1
 Reviewer:                |        Sponsor:
--------------------------+------------------------------------

Comment (by dgoulet):

 Replying to [comment:2 teor]:
 > Applying this patch will cause a double-free~~ in master.~~

 I don't see it... but maybe it's early morning :P.

 We put the dir1/dir2 string in the service object and then we nullify
 their pointers so the tor_free() later will _not_ free their values
 leading to one single free within the service free?

 {{{
   service_1->directory = dir1;
   service_2->directory = dir2;
   /* The services own the directory pointers now */
   dir1 = dir2 = NULL;
 }}}

 What am I missing?

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


More information about the tor-bugs mailing list