Bug 586671 AffixMgr::parse_convtable leaks pattern/pattern2 if it can't create both. r=ryanvm, a=roc.

--HG--
extra : rebase_source : 62aa3d65a700fba3f17bd9978cc196f77470bb1b
This commit is contained in:
timeless@mozdev.org 2011-01-30 12:45:04 +13:00
parent 528820e4e8
commit 9e9a234f7e

View File

@ -3534,11 +3534,15 @@ int AffixMgr::parse_convtable(char * line, FileMgr * af, RepList ** rl, const c
}
piece = mystrsep(&tp, 0);
}
if (!pattern || !pattern2) {
HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum());
return 1;
}
(*rl)->add(pattern, pattern2);
if (!pattern || !pattern2) {
if (pattern)
free(pattern);
if (pattern2)
free(pattern2);
HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum());
return 1;
}
(*rl)->add(pattern, pattern2);
}
return 0;
}