aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2013-04-25 20:48:20 +0200
committerWillem Jan Palenstijn2013-04-25 20:48:32 +0200
commit38fa74d24ab5065acfdbd65ff3432cd33080d1f1 (patch)
tree935d64a5740c825f8f1a77681b8430b1fc2fc3fb /engines/sci
parentd8eb01a7290e7a809b2e778fbb1eddada6854036 (diff)
downloadscummvm-rg350-38fa74d24ab5065acfdbd65ff3432cd33080d1f1.tar.gz
scummvm-rg350-38fa74d24ab5065acfdbd65ff3432cd33080d1f1.tar.bz2
scummvm-rg350-38fa74d24ab5065acfdbd65ff3432cd33080d1f1.zip
SCI: Fix (unlikely) memory leak
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/parser/grammar.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/sci/parser/grammar.cpp b/engines/sci/parser/grammar.cpp
index 6e02eb75e3..26e3ec9238 100644
--- a/engines/sci/parser/grammar.cpp
+++ b/engines/sci/parser/grammar.cpp
@@ -386,8 +386,10 @@ ParseRuleList *Vocabulary::buildGNF(bool verbose) {
for (uint i = 1; i < _parserBranches.size(); i++) { // branch rule 0 is treated specially
ParseRule *rule = _vbuild_rule(&_parserBranches[i]);
- if (!rule)
+ if (!rule) {
+ freeRuleList(ntlist);
return NULL;
+ }
ntlist = _vocab_add_rule(ntlist, rule);
}