diff --git a/src/lib/util/corealloc.cpp b/src/lib/util/corealloc.cpp index e3b7a458dbf..789e8325204 100644 --- a/src/lib/util/corealloc.cpp +++ b/src/lib/util/corealloc.cpp @@ -14,7 +14,7 @@ std::uint8_t g_mame_new_prefill_byte(0xcd); void *operator new(std::size_t n) { - void *const result(std::malloc(sz)); + void *const result(std::malloc(n)); if (ptr) { std::fill_n(reinterpret_cast(ptr), n, g_mame_new_prefill_byte);