From b66ca56ba14c9053c09cd6891c739d31a509fa65 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sun, 14 Oct 2018 17:59:43 -0400 Subject: [PATCH] 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. --- new.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/new.cc b/new.cc index fc5d5e5..3798355 100644 --- a/new.cc +++ b/new.cc @@ -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();