Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,12 @@ INTERCEPTOR(void, free, void *ptr) {
if (DlsymAlloc::PointerIsMine(ptr))
return DlsymAlloc::Free(ptr);

if (ptr != NULL) {
// According to the C and C++ standard, freeing a nullptr is guaranteed to be
// a no-op (and thus real-time safe). This can be confirmed for looking at
// __libc_free in the glibc source.
if (ptr != nullptr)
__rtsan_notify_intercepted_call("free");
}

return REAL(free)(ptr);
}

Expand Down
Loading