adsldp: Fix memory leaks (Valgrind).

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2020-04-17 17:12:13 +08:00 committed by Alexandre Julliard
parent 213404da80
commit 2ff5eb7f13
2 changed files with 8 additions and 0 deletions

View File

@ -785,12 +785,14 @@ static HRESULT WINAPI ldapns_GetInfoEx(IADs *iface, VARIANT prop, LONG reserved)
{
ldap_value_freeW(values);
ldap_memfreeW(attr);
ber_free(ber, 0);
goto exit;
}
attr = ldap_next_attributeW(ldap->ld, entry, ber);
}
ber_free(ber, 0);
entry = ldap_next_entry(ldap->ld, res);
}
@ -1812,6 +1814,8 @@ static HRESULT WINAPI search_FreeColumn(IDirectorySearch *iface, PADS_SEARCH_COL
if (!col) return E_ADS_BAD_PARAMETER;
if (!wcsicmp(col->pszAttrName, L"ADsPath"))
heap_free(col->pADsValues[0].u.CaseIgnoreString);
heap_free(col->pADsValues);
heap_free(col->pszAttrName);
@ -1839,6 +1843,9 @@ static HRESULT WINAPI search_CloseSearchHandle(IDirectorySearch *iface, ADS_SEAR
ldap_search_abandon_page(ldap->ld, ldap_ctx->page);
if (ldap_ctx->res)
ldap_msgfree(ldap_ctx->res);
if (ldap_ctx->ber)
ber_free(ldap_ctx->ber, 0);
heap_free(ldap_ctx);
return S_OK;
}

View File

@ -433,6 +433,7 @@ struct attribute_type *load_schema(LDAP *ld, ULONG *at_single_count, ULONG *at_m
}
exit:
ldap_value_freeW(schema);
ldap_msgfree(res);
if (at)
{