Commit f16e2c3a authored by Jeff Latimer's avatar Jeff Latimer Committed by Alexandre Julliard

shell32: Fix possible dereference of NULL ptr.

parent 0678f6d1
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment