Andrew Eikum : ole32: Repair leak on error path.

Alexandre Julliard julliard at winehq.org
Thu Aug 20 12:59:16 CDT 2009


Module: wine
Branch: master
Commit: 7ca31e83f0f46b1c675dab95483cbb8d18b70259
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7ca31e83f0f46b1c675dab95483cbb8d18b70259

Author: Andrew Eikum <aeikum at codeweavers.com>
Date:   Wed Aug 19 15:19:03 2009 -0500

ole32: Repair leak on error path.

---

 dlls/ole32/storage32.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index 212c1ff..90eafb7 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -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;




More information about the wine-cvs mailing list