[SHELL32]
authorThomas Faber <thomas.faber@reactos.org>
Mon, 9 May 2016 08:12:00 +0000 (08:12 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Mon, 9 May 2016 08:12:00 +0000 (08:12 +0000)
- Fix uninitialized return value in _SHGetDefaultValue. CID 1322231
CORE-11213 #resolve

svn path=/trunk/; revision=71295

reactos/dll/win32/shell32/wine/shellpath.c

index f26dd49..c65ac4e 100644 (file)
@@ -1518,6 +1518,7 @@ static HRESULT _SHGetDefaultValue(HANDLE hToken, BYTE folder, LPWSTR pszPath)
         ; /* no corresponding env. var, do nothing */
     }
 
+    hr = S_OK;
     if (CSIDL_Data[folder].szDefaultPath)
     {
         if (IS_INTRESOURCE(CSIDL_Data[folder].szDefaultPath))
@@ -1525,7 +1526,6 @@ static HRESULT _SHGetDefaultValue(HANDLE hToken, BYTE folder, LPWSTR pszPath)
             if (LoadStringW(shell32_hInstance,
                 LOWORD(CSIDL_Data[folder].szDefaultPath), resourcePath, MAX_PATH))
             {
-                hr = S_OK;
                 PathAppendW(pszPath, resourcePath);
             }
             else
@@ -1537,7 +1537,6 @@ static HRESULT _SHGetDefaultValue(HANDLE hToken, BYTE folder, LPWSTR pszPath)
         }
         else
         {
-            hr = S_OK;
             PathAppendW(pszPath, CSIDL_Data[folder].szDefaultPath);
         }
     }