Yes, if that is the only code-path for cleanup, then there is a memory leak there. Note, however, if this is only ever executed by MAME shutdown code, then it's probably not a big deal as the OS will 'free' the memory when the application (MAME) exits.