[v3 PATCH 3/3] ieframe: Handle storage opening failure in shortcut Load()

Nikolay Sivov nsivov at codeweavers.com
Mon Apr 11 14:14:56 CDT 2016


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---

v3: new patch

 dlls/ieframe/intshcut.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/ieframe/intshcut.c b/dlls/ieframe/intshcut.c
index 563cfc2..2376b1b 100644
--- a/dlls/ieframe/intshcut.c
+++ b/dlls/ieframe/intshcut.c
@@ -483,6 +483,15 @@ static HRESULT WINAPI PersistFile_Load(IPersistFile *pFile, LPCOLESTR pszFileNam
         return hr;
     }
 
+    hr = IPropertySetStorage_Open(This->property_set_storage, &FMTID_Intshcut,
+                STGM_READWRITE | STGM_SHARE_EXCLUSIVE, &pPropStg);
+    if (FAILED(hr))
+    {
+        CoTaskMemFree(filename);
+        CoTaskMemFree(url);
+        return hr;
+    }
+
     CoTaskMemFree(This->currentFile);
     This->currentFile = filename;
     CoTaskMemFree(This->url);
@@ -492,8 +501,6 @@ static HRESULT WINAPI PersistFile_Load(IPersistFile *pFile, LPCOLESTR pszFileNam
     /* Now we're going to read in the iconfile and iconindex.
        If we don't find them, that's not a failure case -- it's possible
        that they just aren't in there. */
-    hr = IPropertySetStorage_Open(This->property_set_storage, &FMTID_Intshcut,
-                STGM_READWRITE | STGM_SHARE_EXCLUSIVE, &pPropStg);
 
     if (get_profile_string(str_header, str_iconfile, pszFileName, &iconfile) == S_OK)
     {
-- 
2.8.0.rc3




More information about the wine-patches mailing list