mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 06:39:17 +00:00
SCI: Fix memleak
svn-id: r52986
This commit is contained in:
parent
ab46bf0f61
commit
a6839d5ffd
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user