summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2019-11-25 03:29:33 +1100
committer Vas Crabb <vas@vastheman.com>2019-11-25 03:29:33 +1100
commit8c4f10d3aa59fd8a49a5cedb4dcee37775fe6b20 (patch)
tree7c8fe048359a4c98a708566ed47bfe9dcbb6256f /src/lib/util
parent9525108f78153c049b79510bdb64336c2ebdcb87 (diff)
apparently 3AM is not the time to code (nw)
Diffstat (limited to 'src/lib/util')
-rw-r--r--src/lib/util/corealloc.cpp6
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
{