fix memory leaks in address book r=mscott

git-svn-id: svn://10.0.0.236/trunk@51284 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bienvenu%netscape.com
1999-10-20 20:41:27 +00:00
parent 8d734dfcc2
commit 004de2f422
3 changed files with 3 additions and 1 deletions

View File

@@ -410,7 +410,7 @@ NS_IMETHODIMP nsAbCardProperty::SetCardValue(const char *attrname, const PRUnich
nsAutoString cardValue(value);
char* valueStr = cardValue.ToNewCString();
rv = SetAnonymousStringAttribute(attrname, valueStr);
delete[] valueStr;
nsAllocator::Free(valueStr);
}
return rv;
}

View File

@@ -454,6 +454,7 @@ nsresult nsAbCardDataSource::DoNewCard(nsIAbCard *card, nsISupportsArray *argume
PRUnichar *name;
literal->GetValue(&name);
nsString tempStr = name;
nsAllocator::Free(name);
nsAutoCString nameStr(tempStr);
// rv = card->CreateNewCard(nameStr);

View File

@@ -626,6 +626,7 @@ nsresult nsAbDirectoryDataSource::DoNewDirectory(nsIAbDirectory *directory, nsIS
literal->GetValue(&name);
rv = directory->CreateNewDirectory(name, nsnull);
nsAllocator::Free(name);
}
return rv;
}