ole32: Repair leak on error path.

This commit is contained in:
Andrew Eikum 2009-08-19 15:19:03 -05:00 committed by Alexandre Julliard
parent a18fc6ec76
commit 7ca31e83f0
1 changed files with 4 additions and 2 deletions

View File

@ -3586,9 +3586,13 @@ BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
} while (cbTotalRead.QuadPart < size.QuadPart);
HeapFree(GetProcessHeap(),0,buffer);
size.u.HighPart = 0;
size.u.LowPart = 0;
if (FAILED(resRead) || FAILED(resWrite))
{
ERR("conversion failed: resRead = 0x%08x, resWrite = 0x%08x\n", resRead, resWrite);
BlockChainStream_SetSize(bbTempChain, size);
BlockChainStream_Destroy(bbTempChain);
return NULL;
}
@ -3597,8 +3601,6 @@ BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
* Destroy the small block chain.
*/
propertyIndex = (*ppsbChain)->ownerPropertyIndex;
size.u.HighPart = 0;
size.u.LowPart = 0;
SmallBlockChainStream_SetSize(*ppsbChain, size);
SmallBlockChainStream_Destroy(*ppsbChain);
*ppsbChain = 0;