shell32: Fix possible dereference of NULL ptr.

This commit is contained in:
Jeff Latimer 2007-06-10 17:42:50 +10:00 committed by Alexandre Julliard
parent 0678f6d168
commit f16e2c3a27
1 changed files with 6 additions and 2 deletions

View File

@ -584,8 +584,12 @@ static HRESULT Stream_LoadString( IStream* stm, BOOL unicode, LPWSTR *pstr )
{
count = MultiByteToWideChar( CP_ACP, 0, (LPSTR) temp, len, NULL, 0 );
str = HeapAlloc( GetProcessHeap(), 0, (count+1)*sizeof (WCHAR) );
if( str )
MultiByteToWideChar( CP_ACP, 0, (LPSTR) temp, len, str, count );
if( !str )
{
HeapFree( GetProcessHeap(), 0, temp );
return E_OUTOFMEMORY;
}
MultiByteToWideChar( CP_ACP, 0, (LPSTR) temp, len, str, count );
HeapFree( GetProcessHeap(), 0, temp );
}
else