shell32: Fix possible dereference of NULL ptr.
This commit is contained in:
parent
0678f6d168
commit
f16e2c3a27
@ -584,8 +584,12 @@ static HRESULT Stream_LoadString( IStream* stm, BOOL unicode, LPWSTR *pstr )
|
|||||||
{
|
{
|
||||||
count = MultiByteToWideChar( CP_ACP, 0, (LPSTR) temp, len, NULL, 0 );
|
count = MultiByteToWideChar( CP_ACP, 0, (LPSTR) temp, len, NULL, 0 );
|
||||||
str = HeapAlloc( GetProcessHeap(), 0, (count+1)*sizeof (WCHAR) );
|
str = HeapAlloc( GetProcessHeap(), 0, (count+1)*sizeof (WCHAR) );
|
||||||
if( str )
|
if( !str )
|
||||||
MultiByteToWideChar( CP_ACP, 0, (LPSTR) temp, len, str, count );
|
{
|
||||||
|
HeapFree( GetProcessHeap(), 0, temp );
|
||||||
|
return E_OUTOFMEMORY;
|
||||||
|
}
|
||||||
|
MultiByteToWideChar( CP_ACP, 0, (LPSTR) temp, len, str, count );
|
||||||
HeapFree( GetProcessHeap(), 0, temp );
|
HeapFree( GetProcessHeap(), 0, temp );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user