aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/alan3/output.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2019-07-04 20:54:59 -0700
committerPaul Gilbert2019-07-06 15:27:09 -0700
commit4de30c9e2f02d028660bbfa1011047747abba548 (patch)
tree07b257220ac736e19d82dbf2b37aa701e0b32255 /engines/glk/alan3/output.cpp
parent87a86c0fb61add346a368c27407be990c2827c4c (diff)
downloadscummvm-rg350-4de30c9e2f02d028660bbfa1011047747abba548.tar.gz
scummvm-rg350-4de30c9e2f02d028660bbfa1011047747abba548.tar.bz2
scummvm-rg350-4de30c9e2f02d028660bbfa1011047747abba548.zip
GLK: ALAN3: Fix Valgrind identified memory issues
Diffstat (limited to 'engines/glk/alan3/output.cpp')
-rw-r--r--engines/glk/alan3/output.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/glk/alan3/output.cpp b/engines/glk/alan3/output.cpp
index 0d946114dc..1ac2cd69a7 100644
--- a/engines/glk/alan3/output.cpp
+++ b/engines/glk/alan3/output.cpp
@@ -424,10 +424,12 @@ void output(const char *original) {
if (lastCharOf(str) != ' ')
needSpace = TRUE;
}
+
if (needSpace)
capitalize = strchr("!?.", str[strlen(str) - 1]) != 0;
+
anyOutput = TRUE;
- free(copy);
+ delete[] copy;
}