Ticket #2036 (closed defect: wontfix)

Opened 13 years ago

Last modified 11 years ago

Redundant NULL checks before free()

Reported by: pavlinux Owned by:
Priority: trivial Milestone:
Component: mc-core Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:


Redundant NULL checks before free()

ANSI-C Standard:

The ANSI standard ANSI X3.159-1989 "Programming Language C."
specifies that free(NULL) is a no op.

"free deallocates the space pointed to by p: it does nothing if p is NULL."

Quoted from "The C Programming Language"
second edition by Kernighan and Ritchie with the subtitle "ANSI C".

  1. Kernighan and D. Ritchie, "Programming Language C",

Second edition. ISBN 5-8459-0891-4
Chapter 8.7 "Example - Memory Allocator", page 197, 2 line from the bottom :)

"... if the pointer is NULL, creates releases list of free blocks.
It contains one block of size zero, and points back to itself "


redundant.diff (6.8 KB) - added by pavlinux 13 years ago.
redundant checks

Change History

Changed 13 years ago by pavlinux

redundant checks

comment:1 Changed 13 years ago by andrew_b

  • Priority changed from major to trivial

comment:2 Changed 11 years ago by andrew_b

  • Status changed from new to closed
  • Resolution set to wontfix
  • Branch state set to no branch
  • Milestone 4.7 deleted
Note: See TracTickets for help on using tickets.