diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index bbddef26f4d..69c95c63bd7 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -1617,8 +1617,11 @@ HRESULT WINAPI SHGetFolderPathW( default: FIXME("bogus type %d, please fix\n", type); hr = E_INVALIDARG; + break; } + if (FAILED(hr)) goto end; + /* Expand environment strings if necessary */ if (*szTemp == '%') hr = _SHExpandEnvironmentStrings(szTemp, szBuildPath);