shlwapi: Avoid potential NULL pointer access if HeapAlloc fails.
This commit is contained in:
parent
968d464f17
commit
35a9587613
|
@ -364,22 +364,21 @@ 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->ref = 1;
|
||||||
fileStream->IStream_iface.lpVtbl = &SHLWAPI_fsVTable;
|
fileStream->hFile = hFile;
|
||||||
fileStream->ref = 1;
|
fileStream->dwMode = dwMode;
|
||||||
fileStream->hFile = hFile;
|
fileStream->lpszPath = StrDupW(lpszPath);
|
||||||
fileStream->dwMode = dwMode;
|
fileStream->type = 0; /* FIXME */
|
||||||
fileStream->lpszPath = StrDupW(lpszPath);
|
fileStream->grfStateBits = 0; /* FIXME */
|
||||||
fileStream->type = 0; /* FIXME */
|
|
||||||
fileStream->grfStateBits = 0; /* FIXME */
|
TRACE ("Returning %p\n", fileStream);
|
||||||
}
|
return &fileStream->IStream_iface;
|
||||||
TRACE ("Returning %p\n", fileStream);
|
|
||||||
return &fileStream->IStream_iface;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
|
Loading…
Reference in New Issue