initialize ptr to nullptr in handle_out_of_memory

It will break out of the loop in the first iteration if there's no
handler or the handler throws an out-of-memory error.
This commit is contained in:
Daniel Micay 2018-10-14 17:59:43 -04:00
parent 4fbfe4d3ec
commit b66ca56ba1

2
new.cc
View File

@ -9,7 +9,7 @@ extern "C" {
}
COLD static void *handle_out_of_memory(size_t size, bool nothrow) {
void *ptr;
void *ptr = nullptr;
do {
std::new_handler handler = std::get_new_handler();