Vincent Povirk : ole32: Add error checking to StorageBaseImpl_CreateStorage .

Alexandre Julliard julliard at winehq.org
Mon Feb 15 10:06:12 CST 2010


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

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Sat Feb 13 12:46:18 2010 -0600

ole32: Add error checking to StorageBaseImpl_CreateStorage.

---

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

diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index a7c12b5..88e0524 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -1132,15 +1132,22 @@ static HRESULT WINAPI StorageBaseImpl_CreateStorage(
   /*
    * Create a new directory entry for the storage
    */
-  StorageBaseImpl_CreateDirEntry(This, &newEntry, &newEntryRef);
+  hr = StorageBaseImpl_CreateDirEntry(This, &newEntry, &newEntryRef);
+  if (FAILED(hr))
+    return hr;
 
   /*
    * Insert the new directory entry into the parent storage's tree
    */
-  insertIntoTree(
+  hr = insertIntoTree(
     This,
     This->storageDirEntry,
     newEntryRef);
+  if (FAILED(hr))
+  {
+    StorageBaseImpl_DestroyDirEntry(This, newEntryRef);
+    return hr;
+  }
 
   /*
    * Open it to get a pointer to return.




More information about the wine-cvs mailing list