Bug 1668926 - fix resource leak in nsBayesianFilter::classifyMessage. r=benc
CID 1494443 Resource leak The system resource will not be reclaimed and reused, reducing the future availability of the resource. In nsBayesianFilter::classifyMessage(Tokenizer &, nsTSubstring<char> const &, nsTArray<unsigned int> &, nsTArray<unsigned int> &, nsIJunkMailClassificationListener *, nsIMsgTraitClassificationListener *, nsIMsgTraitDetailListener *): Leak of memory or pointers to system resources Differential Revision: https://phabricator.services.mozilla.com/D132777 --HG-- extra : rebase_source : fa28ca85b1e484497822eb8775b51b2e8d9d5778
This commit is contained in:
Родитель
7931382298
Коммит
5d4457df12
|
@ -1421,6 +1421,10 @@ void nsBayesianFilter::classifyMessage(
|
||||||
nsIJunkMailClassificationListener* listener,
|
nsIJunkMailClassificationListener* listener,
|
||||||
nsIMsgTraitClassificationListener* aTraitListener,
|
nsIMsgTraitClassificationListener* aTraitListener,
|
||||||
nsIMsgTraitDetailListener* aDetailListener) {
|
nsIMsgTraitDetailListener* aDetailListener) {
|
||||||
|
if (aProTraits.Length() != aAntiTraits.Length()) {
|
||||||
|
NS_ERROR("Each Pro trait needs a matching Anti trait");
|
||||||
|
return;
|
||||||
|
}
|
||||||
Token* tokens = tokenizer.copyTokens();
|
Token* tokens = tokenizer.copyTokens();
|
||||||
uint32_t tokenCount;
|
uint32_t tokenCount;
|
||||||
if (!tokens) {
|
if (!tokens) {
|
||||||
|
@ -1432,11 +1436,6 @@ void nsBayesianFilter::classifyMessage(
|
||||||
tokenCount = tokenizer.countTokens();
|
tokenCount = tokenizer.countTokens();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aProTraits.Length() != aAntiTraits.Length()) {
|
|
||||||
NS_ERROR("Each Pro trait needs a matching Anti trait");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* this part is similar to the Graham algorithm with some adjustments. */
|
/* this part is similar to the Graham algorithm with some adjustments. */
|
||||||
uint32_t traitCount = aProTraits.Length();
|
uint32_t traitCount = aProTraits.Length();
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче