Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #24484

Closed (moved)
(moved)
Open
Created Dec 01, 2017 by Taylor Yu@catalyst

free(NULL) always works (nowadays) so stop acting like it might not

src/common/util.h has the following text in a comment:

 * Unlike the free() function, tor_free() will still work on NULL pointers,
 * and it sets the pointer value to NULL after freeing it.

free(NULL) has been required to be a no-op since C89 at least. Some pre-ANSI platforms might have had a libc free() that didn't allow a null pointer, but we mostly don't care about those.

We should stop propagating this common misconception that free(NULL) might undefined on modern platforms. We should remove that text from the comment and remove the conditional from the implementation.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking