diff options
author | Willem Jan Palenstijn | 2010-10-02 23:17:19 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2010-10-02 23:17:19 +0000 |
commit | a6839d5ffdb1a6446ec77f26d6136694592dae13 (patch) | |
tree | bb0469f5f46906c6c8b623f744dbc08b0d69bbf2 /engines | |
parent | ab46bf0f61b5c18acbd3abbf0f8cd42ccd9f9956 (diff) | |
download | scummvm-rg350-a6839d5ffdb1a6446ec77f26d6136694592dae13.tar.gz scummvm-rg350-a6839d5ffdb1a6446ec77f26d6136694592dae13.tar.bz2 scummvm-rg350-a6839d5ffdb1a6446ec77f26d6136694592dae13.zip |
SCI: Fix memleak
svn-id: r52986
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/parser/grammar.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/engines/sci/parser/grammar.cpp b/engines/sci/parser/grammar.cpp index ad00397057..ae5ff81045 100644 --- a/engines/sci/parser/grammar.cpp +++ b/engines/sci/parser/grammar.cpp @@ -277,10 +277,8 @@ static ParseRuleList *_vocab_add_rule(ParseRuleList *list, ParseRule *rule) { while (seeker->next/* && seeker->next->terminal <= term*/) { if (seeker->next->terminal == term) { if (*(seeker->next->rule) == *rule) { - delete rule; - // FIXME: not sure about this change, fixes pq2 crashing when having opened the cabinet - // and typing "go to bains" - delete rule deletes part of new_elem - //delete new_elem; + delete new_elem; // NB: This also deletes 'rule' + return list; // No duplicate rules } } |