[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 Nov 17 16:44:54 UTC 2017


#24337: Every _free() function should be a macro that sets the corresponding
pointer to NULL.
------------------------------+--------------------------------
     Reporter:  nickm         |      Owner:  nickm
         Type:  enhancement   |     Status:  assigned
     Priority:  Medium        |  Milestone:  Tor: 0.3.3.x-final
    Component:  Core Tor/Tor  |    Version:
     Severity:  Normal        |   Keywords:
Actual Points:                |  Parent ID:
       Points:                |   Reviewer:
      Sponsor:                |
------------------------------+--------------------------------
 Our tor_free() macros has saved us a bunch of trouble in the past by
 ensuring that once we've freed a pointer, that pointer gets set to NULL.

 Wouldn't it be cool if all of our free() calls did this?  It should make
 our code generally less error-prone.

 As we work on #23847, I bet we will find it extremely helpful.

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


More information about the tor-bugs mailing list