Fix the a problem exposed by another bug, where out params were not correctly set to null. Part of fix for bug 80722 (crash creating new profile).

git-svn-id: svn://10.0.0.236/trunk@94909 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sfraser%netscape.com
2001-05-15 00:34:10 +00:00
parent 05952b76d0
commit 55e9cbf26f

View File

@@ -205,13 +205,13 @@ nsFSStringConversion::UCSToNewFS( const PRUnichar* aIn, char** aOut)
res= mEncoder->GetMaxLength(aIn, inLength,&outLength);
if(NS_SUCCEEDED(res)) {
*aOut = (char*)nsMemory::Alloc(outLength+1);
if(nsnull != aOut) {
if(nsnull != *aOut) {
res = mEncoder->Convert(aIn, &inLength, *aOut, &outLength);
if(NS_SUCCEEDED(res)) {
(*aOut)[outLength] = '\0';
} else {
nsMemory::Free(*aOut);
aOut = nsnull;
*aOut = nsnull;
}
} else {
res = NS_ERROR_OUT_OF_MEMORY;
@@ -234,13 +234,13 @@ nsFSStringConversion::FSToNewUCS( const char* aIn, PRUnichar** aOut)
res= mDecoder->GetMaxLength(aIn, inLength,&outLength);
if(NS_SUCCEEDED(res)) {
*aOut = (PRUnichar*)nsMemory::Alloc(2*(outLength+1));
if(nsnull != aOut) {
if(nsnull != *aOut) {
res = mDecoder->Convert(aIn, &inLength, *aOut, &outLength);
if(NS_SUCCEEDED(res)) {
(*aOut)[outLength] = '\0';
} else {
nsMemory::Free(*aOut);
aOut = nsnull;
*aOut = nsnull;
}
} else {
res = NS_ERROR_OUT_OF_MEMORY;