[PATCH 0/1] MR3001: hhctrl: Fix memory leak on error path in resolve_filename (scan-build).
From: Alex Henrie <alexhenrie24(a)gmail.com> --- dlls/hhctrl.ocx/hhctrl.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/hhctrl.ocx/hhctrl.c b/dlls/hhctrl.ocx/hhctrl.c index 829c1c5305b..3de9a741422 100644 --- a/dlls/hhctrl.ocx/hhctrl.c +++ b/dlls/hhctrl.ocx/hhctrl.c @@ -148,7 +148,14 @@ static BOOL resolve_filename(const WCHAR *env_filename, WCHAR *fullname, DWORD b free(filename); - return (GetFileAttributesW(fullname) != INVALID_FILE_ATTRIBUTES); + if (GetFileAttributesW(fullname) == INVALID_FILE_ATTRIBUTES) + { + if (window) free(*window); + if (index) free(*index); + return FALSE; + } + + return TRUE; } /****************************************************************** -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3001
This merge request was approved by Hans Leidekker. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3001
participants (3)
-
Alex Henrie -
Alex Henrie (@alexhenrie) -
Hans Leidekker (@hans)