mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 17:55:50 +00:00
fix leak in case it fails (GetLocalPath might return nsnull)
This commit is contained in:
parent
2de3b5c34f
commit
e7fe1f0f6e
@ -393,7 +393,7 @@ void nsMessenger::InitializeFolderRoot()
|
|||||||
nsCOMPtr<nsIMsgIncomingServer> server;
|
nsCOMPtr<nsIMsgIncomingServer> server;
|
||||||
rv = mailSession->GetCurrentServer(getter_AddRefs(server));
|
rv = mailSession->GetCurrentServer(getter_AddRefs(server));
|
||||||
|
|
||||||
char * folderRoot;
|
char * folderRoot=nsnull;
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
rv = server->GetLocalPath(&folderRoot);
|
rv = server->GetLocalPath(&folderRoot);
|
||||||
|
|
||||||
@ -402,8 +402,8 @@ void nsMessenger::InitializeFolderRoot()
|
|||||||
// tack that folder name on to the root path...
|
// tack that folder name on to the root path...
|
||||||
m_folderPath = folderRoot;
|
m_folderPath = folderRoot;
|
||||||
m_folderPath += "Inbox";
|
m_folderPath += "Inbox";
|
||||||
PR_FREEIF(folderRoot);
|
|
||||||
} // if we have a folder root for the current server
|
} // if we have a folder root for the current server
|
||||||
|
if (folderRoot) PL_strfree(folderRoot);
|
||||||
|
|
||||||
// create Undo/Redo Transaction Manager
|
// create Undo/Redo Transaction Manager
|
||||||
NS_WITH_SERVICE (nsIComponentManager, compMgr, kComponentManagerCID, &rv);
|
NS_WITH_SERVICE (nsIComponentManager, compMgr, kComponentManagerCID, &rv);
|
||||||
|
Loading…
Reference in New Issue
Block a user