diff --git a/dlls/ole32/git.c b/dlls/ole32/git.c index 4d44e392121..b83d415ce93 100644 --- a/dlls/ole32/git.c +++ b/dlls/ole32/git.c @@ -180,7 +180,12 @@ StdGlobalInterfaceTable_RegisterInterfaceInGlobal( IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL); entry = HeapAlloc(GetProcessHeap(), 0, sizeof(StdGITEntry)); - if (entry == NULL) return E_OUTOFMEMORY; + if (!entry) + { + CoReleaseMarshalData(stream); + IStream_Release(stream); + return E_OUTOFMEMORY; + } EnterCriticalSection(&git_section);