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:
parent
4fbfe4d3ec
commit
b66ca56ba1
2
new.cc
2
new.cc
@ -9,7 +9,7 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
COLD static void *handle_out_of_memory(size_t size, bool nothrow) {
|
COLD static void *handle_out_of_memory(size_t size, bool nothrow) {
|
||||||
void *ptr;
|
void *ptr = nullptr;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
std::new_handler handler = std::get_new_handler();
|
std::new_handler handler = std::get_new_handler();
|
||||||
|
Loading…
Reference in New Issue
Block a user