diff --git a/libcxx/src/new.cpp b/libcxx/src/new.cpp --- a/libcxx/src/new.cpp +++ b/libcxx/src/new.cpp @@ -130,8 +130,7 @@ void operator delete(void* ptr) _NOEXCEPT { - if (ptr) - ::free(ptr); + ::free(ptr); } _LIBCPP_WEAK @@ -252,9 +251,7 @@ void operator delete(void* ptr, std::align_val_t) _NOEXCEPT { - if (ptr) { - std::__libcpp_aligned_free(ptr); - } + std::__libcpp_aligned_free(ptr); } _LIBCPP_WEAK diff --git a/libcxxabi/src/stdlib_new_delete.cpp b/libcxxabi/src/stdlib_new_delete.cpp --- a/libcxxabi/src/stdlib_new_delete.cpp +++ b/libcxxabi/src/stdlib_new_delete.cpp @@ -214,9 +214,7 @@ void operator delete(void* ptr, std::align_val_t) _NOEXCEPT { - if (ptr) { - std::__libcpp_aligned_free(ptr); - } + std::__libcpp_aligned_free(ptr); } _LIBCXXABI_WEAK