dirmngr: Fix resource leaks and check rare errors.
* dirmngr/ks-engine-ldap.c (keyspec_to_ldap_filter): Fix resource leak. (ks_ldap_search): Check error from es_fopenmem. Use LDAP_ERR where required. (modlist_dump): Check error from es_fopenmem. (uncescape): s/int/size_t/. Use existing macros. (extract_attributes): Use existing trim function. (ks_ldap_put): Do not segv on error from modlist_dump.
- Signed-off-by: Werner Koch <wk@gnupg.org>