mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
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:
parent
528820e4e8
commit
9e9a234f7e
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user