diff options
author | Paul Gilbert | 2019-07-05 21:07:25 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-07-06 15:27:09 -0700 |
commit | 69f87bebf125b1be5e6d6cfe3432b417d5ca505e (patch) | |
tree | 5690b41cb155d9656896b3cd54febd6421e243eb /engines/glk/alan3 | |
parent | 17d0459566bf570c34ba6873370aff71fd016d1b (diff) | |
download | scummvm-rg350-69f87bebf125b1be5e6d6cfe3432b417d5ca505e.tar.gz scummvm-rg350-69f87bebf125b1be5e6d6cfe3432b417d5ca505e.tar.bz2 scummvm-rg350-69f87bebf125b1be5e6d6cfe3432b417d5ca505e.zip |
GLK: ALAN3: Fix double-free of memory array
Diffstat (limited to 'engines/glk/alan3')
-rw-r--r-- | engines/glk/alan3/exe.cpp | 2 | ||||
-rw-r--r-- | engines/glk/alan3/utils.cpp | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/engines/glk/alan3/exe.cpp b/engines/glk/alan3/exe.cpp index 8c22742347..fbb0db53f4 100644 --- a/engines/glk/alan3/exe.cpp +++ b/engines/glk/alan3/exe.cpp @@ -205,7 +205,7 @@ void quitGame(CONTEXT) { current.location = where(HERO, DIRECT); para(); - while (TRUE) { + while (!g_vm->shouldQuit()) { col = 1; CALL0(g_io->statusLine) printMessage(M_QUITACTION); diff --git a/engines/glk/alan3/utils.cpp b/engines/glk/alan3/utils.cpp index acbf8e490a..06ce3af7ae 100644 --- a/engines/glk/alan3/utils.cpp +++ b/engines/glk/alan3/utils.cpp @@ -49,8 +49,10 @@ void terminate(CONTEXT, int code) { stopTranscript(); - if (memory) + if (memory) { deallocate(memory); + memory = nullptr; + } g_io->glk_exit(); LONG_JUMP |