diff options
author | 2019-11-25 03:29:33 +1100 | |
---|---|---|
committer | 2019-11-25 03:29:33 +1100 | |
commit | 8c4f10d3aa59fd8a49a5cedb4dcee37775fe6b20 (patch) | |
tree | 7c8fe048359a4c98a708566ed47bfe9dcbb6256f | |
parent | 9525108f78153c049b79510bdb64336c2ebdcb87 (diff) |
apparently 3AM is not the time to code (nw)
-rw-r--r-- | src/lib/util/corealloc.cpp | 6 |
1 files 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<std::uint8_t volatile *>(ptr), n, g_mame_new_prefill_byte); - return ptr; + std::fill_n(reinterpret_cast<std::uint8_t volatile *>(result), n, g_mame_new_prefill_byte); + return result; } else { |