Sven Baars : shell32: Fix a leak on error path (Coverity).
Alexandre Julliard
julliard at winehq.org
Mon Oct 5 15:54:59 CDT 2020
Module: wine
Branch: master
Commit: 2dac80524440bbae0ee0ef67c470bc0073b8bfaf
URL: https://source.winehq.org/git/wine.git/?a=commit;h=2dac80524440bbae0ee0ef67c470bc0073b8bfaf
Author: Sven Baars <sbaars at codeweavers.com>
Date: Sun Oct 4 18:10:23 2020 +0200
shell32: Fix a leak on error path (Coverity).
Signed-off-by: Sven Baars <sbaars at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/shell32/shfldr_unixfs.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c
index a37b1bf588..48d5fe4ecb 100644
--- a/dlls/shell32/shfldr_unixfs.c
+++ b/dlls/shell32/shfldr_unixfs.c
@@ -1251,7 +1251,10 @@ static HRESULT WINAPI ShellFolder2_GetDisplayNameOf(IShellFolder2* iface,
LPWSTR pwszDosFileName = wine_get_dos_file_name(This->m_pszPath);
if (!pwszDosFileName) return HRESULT_FROM_WIN32(GetLastError());
lpName->u.pOleStr = SHAlloc((lstrlenW(pwszDosFileName) + 1) * sizeof(WCHAR));
- if (!lpName->u.pOleStr) return HRESULT_FROM_WIN32(GetLastError());
+ if (!lpName->u.pOleStr) {
+ heap_free(pwszDosFileName);
+ return HRESULT_FROM_WIN32(GetLastError());
+ }
lstrcpyW(lpName->u.pOleStr, pwszDosFileName);
PathRemoveBackslashW(lpName->u.pOleStr);
heap_free(pwszDosFileName);
More information about the wine-cvs
mailing list