SCI: Fix (unlikely) memory leak

This commit is contained in:
Willem Jan Palenstijn 2013-04-25 20:48:20 +02:00
parent d8eb01a729
commit 38fa74d24a

View File

@ -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);
}