зеркало из https://github.com/mozilla/pjs.git
fix three backend mailnews memory leaks, r/a=sspitzer, sr=mscott 228561
This commit is contained in:
Родитель
7dc0e571ec
Коммит
1ec41a45c7
|
@ -348,6 +348,7 @@ nsMsgSearchAdapter::GetSearchCharsets(PRUnichar **srcCharset, PRUnichar **dstCha
|
||||||
{
|
{
|
||||||
nsXPIDLCString folderCharset;
|
nsXPIDLCString folderCharset;
|
||||||
folder->GetCharset(getter_Copies(folderCharset));
|
folder->GetCharset(getter_Copies(folderCharset));
|
||||||
|
PR_Free(*dstCharset);
|
||||||
*dstCharset = ToNewUnicode(folderCharset);
|
*dstCharset = ToNewUnicode(folderCharset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -359,7 +360,10 @@ nsMsgSearchAdapter::GetSearchCharsets(PRUnichar **srcCharset, PRUnichar **dstCha
|
||||||
// was undefined or unavailable.)
|
// was undefined or unavailable.)
|
||||||
// ### well, it's not really anymore. Is there an equivalent?
|
// ### well, it's not really anymore. Is there an equivalent?
|
||||||
if (!nsCRT::strcmp(*dstCharset, m_defaultCharset.get()))
|
if (!nsCRT::strcmp(*dstCharset, m_defaultCharset.get()))
|
||||||
|
{
|
||||||
|
PR_Free(*dstCharset);
|
||||||
*dstCharset = nsCRT::strdup(*srcCharset);
|
*dstCharset = nsCRT::strdup(*srcCharset);
|
||||||
|
}
|
||||||
|
|
||||||
if (m_forceAsciiSearch)
|
if (m_forceAsciiSearch)
|
||||||
{
|
{
|
||||||
|
@ -370,6 +374,7 @@ nsMsgSearchAdapter::GetSearchCharsets(PRUnichar **srcCharset, PRUnichar **dstCha
|
||||||
// If the dest csid is ISO Latin 1 or MacRoman, attempt to convert the
|
// If the dest csid is ISO Latin 1 or MacRoman, attempt to convert the
|
||||||
// source text to US-ASCII. (Not for now.)
|
// source text to US-ASCII. (Not for now.)
|
||||||
// if ((dst_csid == CS_LATIN1) || (dst_csid == CS_MAC_ROMAN))
|
// if ((dst_csid == CS_LATIN1) || (dst_csid == CS_MAC_ROMAN))
|
||||||
|
PR_Free(*dstCharset);
|
||||||
*dstCharset = nsCRT::strdup(NS_LITERAL_STRING("us-ascii").get());
|
*dstCharset = nsCRT::strdup(NS_LITERAL_STRING("us-ascii").get());
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
@ -607,6 +607,7 @@ nsMsgIdentity::getFolderPref(const char *prefname, char **retval, PRBool mustHav
|
||||||
{
|
{
|
||||||
nsCOMPtr <nsIMsgFolder> msgFolder;
|
nsCOMPtr <nsIMsgFolder> msgFolder;
|
||||||
rv = server->GetMsgFolderFromURI(folderResource, *retval, getter_AddRefs(msgFolder));
|
rv = server->GetMsgFolderFromURI(folderResource, *retval, getter_AddRefs(msgFolder));
|
||||||
|
PR_Free(*retval);
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
return msgFolder->GetURI(retval);
|
return msgFolder->GetURI(retval);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5456,6 +5456,7 @@ void nsImapProtocol::OnStatusForFolder(const char *mailboxName)
|
||||||
nsImapMailboxSpec *new_spec = GetServerStateParser().CreateCurrentMailboxSpec(mailboxName);
|
nsImapMailboxSpec *new_spec = GetServerStateParser().CreateCurrentMailboxSpec(mailboxName);
|
||||||
if (new_spec && m_imapMailFolderSink)
|
if (new_spec && m_imapMailFolderSink)
|
||||||
m_imapMailFolderSink->UpdateImapMailboxStatus(this, new_spec);
|
m_imapMailFolderSink->UpdateImapMailboxStatus(this, new_spec);
|
||||||
|
NS_IF_RELEASE(new_spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче