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>
This commit is contained in:
Alex Henrie 2022-02-02 00:23:11 -07:00 committed by Alexandre Julliard
parent 2b63fdd9a5
commit 36af682895
1 changed files with 5 additions and 1 deletions

View File

@ -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)