diff --git a/mailnews/base/search/src/nsMsgSearchAdapter.cpp b/mailnews/base/search/src/nsMsgSearchAdapter.cpp index 318d2aba16c..aef318d69d7 100644 --- a/mailnews/base/search/src/nsMsgSearchAdapter.cpp +++ b/mailnews/base/search/src/nsMsgSearchAdapter.cpp @@ -348,6 +348,7 @@ nsMsgSearchAdapter::GetSearchCharsets(PRUnichar **srcCharset, PRUnichar **dstCha { nsXPIDLCString folderCharset; folder->GetCharset(getter_Copies(folderCharset)); + PR_Free(*dstCharset); *dstCharset = ToNewUnicode(folderCharset); } } @@ -359,7 +360,10 @@ nsMsgSearchAdapter::GetSearchCharsets(PRUnichar **srcCharset, PRUnichar **dstCha // was undefined or unavailable.) // ### well, it's not really anymore. Is there an equivalent? if (!nsCRT::strcmp(*dstCharset, m_defaultCharset.get())) + { + PR_Free(*dstCharset); *dstCharset = nsCRT::strdup(*srcCharset); + } 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 // source text to US-ASCII. (Not for now.) // if ((dst_csid == CS_LATIN1) || (dst_csid == CS_MAC_ROMAN)) + PR_Free(*dstCharset); *dstCharset = nsCRT::strdup(NS_LITERAL_STRING("us-ascii").get()); } return NS_OK; diff --git a/mailnews/base/util/nsMsgIdentity.cpp b/mailnews/base/util/nsMsgIdentity.cpp index 3bb8c681441..c1e92f75b12 100644 --- a/mailnews/base/util/nsMsgIdentity.cpp +++ b/mailnews/base/util/nsMsgIdentity.cpp @@ -607,6 +607,7 @@ nsMsgIdentity::getFolderPref(const char *prefname, char **retval, PRBool mustHav { nsCOMPtr msgFolder; rv = server->GetMsgFolderFromURI(folderResource, *retval, getter_AddRefs(msgFolder)); + PR_Free(*retval); if (NS_SUCCEEDED(rv)) return msgFolder->GetURI(retval); } diff --git a/mailnews/imap/src/nsImapProtocol.cpp b/mailnews/imap/src/nsImapProtocol.cpp index 4d5dba7b7bf..e10da3e0142 100644 --- a/mailnews/imap/src/nsImapProtocol.cpp +++ b/mailnews/imap/src/nsImapProtocol.cpp @@ -5456,6 +5456,7 @@ void nsImapProtocol::OnStatusForFolder(const char *mailboxName) nsImapMailboxSpec *new_spec = GetServerStateParser().CreateCurrentMailboxSpec(mailboxName); if (new_spec && m_imapMailFolderSink) m_imapMailFolderSink->UpdateImapMailboxStatus(this, new_spec); + NS_IF_RELEASE(new_spec); }