[tor-bugs] #24337 [Core Tor/Tor]: Every _free() function should be a macro that sets the corresponding pointer to NULL.

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Dec 1 15:47:52 UTC 2017


#24337: Every _free() function should be a macro that sets the corresponding
pointer to NULL.
-----------------------------+------------------------------------
 Reporter:  nickm            |          Owner:  nickm
     Type:  enhancement      |         Status:  needs_review
 Priority:  Medium           |      Milestone:  Tor: 0.3.3.x-final
Component:  Core Tor/Tor     |        Version:
 Severity:  Normal           |     Resolution:
 Keywords:  review-group-26  |  Actual Points:
Parent ID:                   |         Points:
 Reviewer:                   |        Sponsor:  Sponsor8-can
-----------------------------+------------------------------------

Comment (by dgoulet):

 Right. The "change the local value" is the part that is making it stand
 out as a "function". But having it upper case won't help much of making
 new developers realize it "could do" something like that imo... It might
 maybe motivate them to go look at the macro?...

 TBH, I personally don't see that as a "problem" for new developers, as
 long as we document it properly. But also, every `tor_*` function, any
 developer should look at them when they use them because we do wrappers
 for safety and/or compatibility reasons which imo MUST be known to any
 developers.

 We could help new developers by adding a note to our HACKING/
 documentation on "if you use tor_*, please go read them" kind of
 statement.

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


More information about the tor-bugs mailing list