mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Fixes top crash in M1RC3 crash [@ nsLocalFile::GetPath], r=rpotts@netscape.com, sr=darin@netscape.com
This commit is contained in:
parent
34fc077f95
commit
41451434dd
@ -2178,7 +2178,11 @@ static nsresult UCS2toFS(const PRUnichar *aBuffer, char **aResult)
|
||||
aBuffer, -1,
|
||||
*aResult, chars, &defaultChar, NULL);
|
||||
if (chars == 0)
|
||||
{
|
||||
nsMemory::Free(*aResult);
|
||||
*aResult = nsnull;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -2200,9 +2204,11 @@ static nsresult FStoUCS2(const char* aBuffer, PRUnichar **aResult)
|
||||
chars = ::MultiByteToWideChar(CP_ACP, 0,
|
||||
aBuffer, -1,
|
||||
*aResult, chars);
|
||||
if (chars == 0)
|
||||
if (chars == 0) {
|
||||
nsMemory::Free(*aResult);
|
||||
*aResult = nsnull;
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user