fix leak of file spec rs=sspitzer 98849

This commit is contained in:
bienvenu%netscape.com 2001-09-28 23:27:52 +00:00
Родитель cd75d63b82
Коммит b60216872c
1 изменённых файлов: 18 добавлений и 14 удалений

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

@ -158,8 +158,11 @@ NS_IMETHODIMP nsAbMDBDirFactory::CreateDirectory(
NS_ENSURE_SUCCESS(rv, rv);
nsFileSpec* dbPath;
abSession->GetUserProfileDirectory(&dbPath);
rv = abSession->GetUserProfileDirectory(&dbPath);
nsCOMPtr<nsIAddrDatabase> listDatabase;
if (dbPath)
{
const char* fileName = nsnull;
const char* uri = URIUTF8.get ();
if (PL_strstr(uri, kMDBDirectoryRoot)) // for moz-abmdbdirectory://
@ -172,8 +175,9 @@ NS_IMETHODIMP nsAbMDBDirFactory::CreateDirectory(
nsCOMPtr<nsIAddrDatabase> addrDBFactory = do_GetService(NS_ADDRDATABASE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIAddrDatabase> listDatabase;
rv = addrDBFactory->Open(dbPath, PR_TRUE, getter_AddRefs(listDatabase), PR_TRUE);
delete dbPath;
}
NS_ENSURE_SUCCESS(rv, rv);
rv = listDatabase->GetMailingListsFromDB(directory);