зеркало из https://github.com/mozilla/gecko-dev.git
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).
This commit is contained in:
Родитель
9b6f545dbc
Коммит
820315ecc5
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче