116422 r/sr=sspitzer. fix leaking us and them upon cancelling news messages

This commit is contained in:
naving%netscape.com 2001-12-26 21:44:55 +00:00
Родитель ec47170658
Коммит c2f3d725e9
1 изменённых файлов: 7 добавлений и 9 удалений

Просмотреть файл

@ -4238,26 +4238,24 @@ PRBool nsNNTPProtocol::CheckIfAuthor(nsISupports *aElement, void *data)
return PR_TRUE; return PR_TRUE;
} }
char *us = nsnull; nsXPIDLCString us;
char *them = nsnull; nsXPIDLCString them;
nsresult rv1 = parser->ExtractHeaderAddressMailboxes(nsnull, cancelInfo->from, &us); nsresult rv1 = parser->ExtractHeaderAddressMailboxes(nsnull, cancelInfo->from, getter_Copies(us));
nsresult rv2 = parser->ExtractHeaderAddressMailboxes(nsnull, cancelInfo->old_from, &them); nsresult rv2 = parser->ExtractHeaderAddressMailboxes(nsnull, cancelInfo->old_from, getter_Copies(them));
PR_LOG(NNTP,PR_LOG_ALWAYS,("us = %s, them = %s", us, them)); PR_LOG(NNTP,PR_LOG_ALWAYS,("us = %s, them = %s", us.get(), them.get()));
if ((NS_FAILED(rv1) || NS_FAILED(rv2) || PL_strcasecmp(us, them))) { if ((NS_FAILED(rv1) || NS_FAILED(rv2) || PL_strcasecmp(us, them))) {
//no match. don't set cancel email //no match. don't set cancel email
PR_FREEIF(cancelInfo->from); PR_FREEIF(cancelInfo->from);
cancelInfo->from = nsnull; cancelInfo->from = nsnull;
PR_FREEIF(us);
PR_FREEIF(them);
// keep going // keep going
return PR_TRUE; return PR_TRUE;
} }
else { else {
// we have a match, stop.
// we have a match, stop.
return PR_FALSE; return PR_FALSE;
} }
} }