From 8c4f10d3aa59fd8a49a5cedb4dcee37775fe6b20 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 25 Nov 2019 03:29:33 +1100 Subject: [PATCH] apparently 3AM is not the time to code (nw) --- src/lib/util/corealloc.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/util/corealloc.cpp b/src/lib/util/corealloc.cpp index 789e8325204..eb6ebe80b37 100644 --- a/src/lib/util/corealloc.cpp +++ b/src/lib/util/corealloc.cpp @@ -15,10 +15,10 @@ std::uint8_t g_mame_new_prefill_byte(0xcd); void *operator new(std::size_t n) { void *const result(std::malloc(n)); - if (ptr) + if (result) { - std::fill_n(reinterpret_cast(ptr), n, g_mame_new_prefill_byte); - return ptr; + std::fill_n(reinterpret_cast(result), n, g_mame_new_prefill_byte); + return result; } else {