Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If realloc() is called with size equal to 0, then if a NULL null pointer is returned, the old value should be unchanged. However, there are some common but non-conforming implementations that free the pointer , which including:

  1. Glibc (GNU/Linux)
  2. AIX
  3. HP-UX
  4. Solaris
  5. OSF/1

This means that calling free on the original pointer might result in a double-free vulnerability. However, not calling free on the original pointer might result in a memory leak.

...