Commit 35a95876 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

shlwapi: Avoid potential NULL pointer access if HeapAlloc fails.

parent 968d464f
...@@ -364,12 +364,11 @@ static const IStreamVtbl SHLWAPI_fsVTable = ...@@ -364,12 +364,11 @@ static const IStreamVtbl SHLWAPI_fsVTable =
*/ */
static IStream *IStream_Create(LPCWSTR lpszPath, HANDLE hFile, DWORD dwMode) static IStream *IStream_Create(LPCWSTR lpszPath, HANDLE hFile, DWORD dwMode)
{ {
ISHFileStream* fileStream; ISHFileStream *fileStream;
fileStream = HeapAlloc(GetProcessHeap(), 0, sizeof(ISHFileStream)); fileStream = HeapAlloc(GetProcessHeap(), 0, sizeof(ISHFileStream));
if (!fileStream) return NULL;
if (fileStream)
{
fileStream->IStream_iface.lpVtbl = &SHLWAPI_fsVTable; fileStream->IStream_iface.lpVtbl = &SHLWAPI_fsVTable;
fileStream->ref = 1; fileStream->ref = 1;
fileStream->hFile = hFile; fileStream->hFile = hFile;
...@@ -377,7 +376,7 @@ static IStream *IStream_Create(LPCWSTR lpszPath, HANDLE hFile, DWORD dwMode) ...@@ -377,7 +376,7 @@ static IStream *IStream_Create(LPCWSTR lpszPath, HANDLE hFile, DWORD dwMode)
fileStream->lpszPath = StrDupW(lpszPath); fileStream->lpszPath = StrDupW(lpszPath);
fileStream->type = 0; /* FIXME */ fileStream->type = 0; /* FIXME */
fileStream->grfStateBits = 0; /* FIXME */ fileStream->grfStateBits = 0; /* FIXME */
}
TRACE ("Returning %p\n", fileStream); TRACE ("Returning %p\n", fileStream);
return &fileStream->IStream_iface; return &fileStream->IStream_iface;
} }
......
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