diff --git a/src/devices/machine/x2212.cpp b/src/devices/machine/x2212.cpp index cae221b6f94..9903762a5a0 100644 --- a/src/devices/machine/x2212.cpp +++ b/src/devices/machine/x2212.cpp @@ -125,8 +125,8 @@ void x2212_device::nvram_default() void x2212_device::nvram_read(emu_file &file) { - uint8_t *buffer = (uint8_t *) alloca(m_size_data); - file.read(buffer, m_size_data); + auto buffer = std::make_unique(m_size_data); + file.read(buffer.get(), m_size_data); for (int byte = 0; byte < m_size_data; byte++) { m_sram->write_byte(byte, 0xff);