Alex Henrie : hhctrl: Fix memory leak on error path in resolve_filename (scan-build).
Module: wine Branch: master Commit: 7b69313bbb7727cadf5be31ccf9a77759300b43c URL: https://gitlab.winehq.org/wine/wine/-/commit/7b69313bbb7727cadf5be31ccf9a777... Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Wed Jun 7 00:02:24 2023 -0600 hhctrl: Fix memory leak on error path in resolve_filename (scan-build). --- 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; } /******************************************************************
participants (1)
-
Alexandre Julliard