blender/intern/guardedalloc
Campbell Barton 49babc7caa Cleanup: early exit MEM_lockfree_freeN when called with NULL pointer
Simplify logic for freeing a NULL pointer. While no null-pointer
de-reference was performed, this wasn't as so obvious as the pointer
was passed to MEM_lockfree_allocN_len before checking for NULL.

NOTE: T99744 claimed the a NULL pointer free was a vulnerability,
while I can't see evidence for this - exiting early makes it clearer
the memory isn't accessed.

*Details*

- Add MEMHEAD_LEN macro, avoids redundant NULL check.
- Use "UNLIKELY(..)" hint's for error cases
  (freeing NULL pointer and checking if `leak_detector_has_run`).
2022-07-16 17:23:42 +10:00
..
cpp File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
intern Cleanup: early exit MEM_lockfree_freeN when called with NULL pointer 2022-07-16 17:23:42 +10:00
test/simpletest File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
tests File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
CMakeLists.txt File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
MEM_guardedalloc.h Cleanup: '*' prefix C-comment blocks 2022-06-01 15:38:48 +10:00