aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/true_talk
diff options
context:
space:
mode:
authorPaul Gilbert2017-09-24 12:26:43 -0400
committerPaul Gilbert2017-09-24 12:26:43 -0400
commitd9eebaf787cb1e4e643d0d4704617d82a94acbcc (patch)
tree0e1a38349c7df0e8890f41271b87e1b9741daea3 /engines/titanic/true_talk
parent47f6c2e9b9687150da6d5d1498fce90523706c28 (diff)
downloadscummvm-rg350-d9eebaf787cb1e4e643d0d4704617d82a94acbcc.tar.gz
scummvm-rg350-d9eebaf787cb1e4e643d0d4704617d82a94acbcc.tar.bz2
scummvm-rg350-d9eebaf787cb1e4e643d0d4704617d82a94acbcc.zip
TITANIC: Fix leak of vocab synonyms on exit
Diffstat (limited to 'engines/titanic/true_talk')
-rw-r--r--engines/titanic/true_talk/tt_node.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/titanic/true_talk/tt_node.cpp b/engines/titanic/true_talk/tt_node.cpp
index fece3b8889..565c4664a9 100644
--- a/engines/titanic/true_talk/tt_node.cpp
+++ b/engines/titanic/true_talk/tt_node.cpp
@@ -58,9 +58,10 @@ void TTnode::deleteSiblings() {
_priorP->_nextP = nullptr;
// Iterate through the linked chain of nodes, deleting each in turn
- for (TTnode *curP = _nextP, *nextP = nullptr; nextP; curP = nextP) {
- nextP = curP->_nextP;
- delete curP;
+ while (_nextP) {
+ TTnode *next = _nextP;
+ _nextP = next->_nextP;
+ delete next;
}
}