Commit 1fab6e35 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

ole32: Add error checking to StorageBaseImpl_CreateStream.

parent 00dec58b
......@@ -834,6 +834,7 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream(
StgStreamImpl* newStream;
DirEntry currentEntry, newStreamEntry;
DirRef currentEntryRef, newStreamEntryRef;
HRESULT hr;
TRACE("(%p, %s, %x, %d, %d, %p)\n",
iface, debugstr_w(pwcsName), grfMode,
......@@ -933,14 +934,22 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream(
/*
* Create an entry with the new data
*/
StorageBaseImpl_CreateDirEntry(This, &newStreamEntry, &newStreamEntryRef);
hr = StorageBaseImpl_CreateDirEntry(This, &newStreamEntry, &newStreamEntryRef);
if (FAILED(hr))
return hr;
/*
* Insert the new entry in the parent storage's tree.
*/
insertIntoTree(
hr = insertIntoTree(
This,
This->storageDirEntry,
newStreamEntryRef);
if (FAILED(hr))
{
StorageBaseImpl_DestroyDirEntry(This, newStreamEntryRef);
return hr;
}
/*
* Open the stream to return it.
......
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