Module: wine Branch: stable Commit: 0344482cf4570088f103bf0c7a375491dd475f4d URL: https://gitlab.winehq.org/wine/wine/-/commit/0344482cf4570088f103bf0c7a37549...
Author: Alex Henrie alexhenrie24@gmail.com Date: Wed Feb 2 00:23:11 2022 -0700
adsldp: Fix memory leak on error path in search_ExecuteSearch (Coverity).
Signed-off-by: Alex Henrie alexhenrie24@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit 36af68289546d942759539acf65b35a9acf43b85) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
dlls/adsldp/adsldp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/adsldp/adsldp.c b/dlls/adsldp/adsldp.c index 3d5ea29882c..c8f63a25e0c 100644 --- a/dlls/adsldp/adsldp.c +++ b/dlls/adsldp/adsldp.c @@ -1302,7 +1302,11 @@ static HRESULT WINAPI search_ExecuteSearch(IDirectorySearch *iface, LPWSTR filte props = NULL; else { - if (count && !names) return E_ADS_BAD_PARAMETER; + if (count && !names) + { + heap_free(ldap_ctx); + return E_ADS_BAD_PARAMETER; + }
props = heap_alloc((count + 1) * sizeof(props[0])); if (!props)