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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -626,6 +626,7 @@ nsresult nsAbDirectoryDataSource::DoNewDirectory(nsIAbDirectory *directory, nsIS
|
||||
literal->GetValue(&name);
|
||||
|
||||
rv = directory->CreateNewDirectory(name, nsnull);
|
||||
nsAllocator::Free(name);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user