From: Marc Fournier Date: Tue, 1 Jul 2014 15:31:07 +0000 (+0200) Subject: openldap: use ldap_unbind_ext_s() to avoid memory leak X-Git-Tag: collectd-5.5.0~152^2~13 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=80cbf58d06cb79456a88ce41fe6407d999b09a46;p=collectd.git openldap: use ldap_unbind_ext_s() to avoid memory leak ... as ldap_destroy() is only available in newer libldap versions. --- diff --git a/src/openldap.c b/src/openldap.c index 5a045781..7ce789fb 100644 --- a/src/openldap.c +++ b/src/openldap.c @@ -94,7 +94,7 @@ static int ldap_init_host (ldap_t *st) /* {{{ */ ERROR ("openldap plugin: Failed to start tls on %s: %s", st->url, ldap_err2string (rc)); st->state = 0; - ldap_destroy(st->ld); + ldap_unbind_ext_s(st->ld, NULL, NULL); return (-1); } } @@ -109,7 +109,7 @@ static int ldap_init_host (ldap_t *st) /* {{{ */ ERROR ("openldap plugin: Failed to bind to %s: %s", st->url, ldap_err2string (rc)); st->state = 0; - ldap_destroy(st->ld); + ldap_unbind_ext_s(st->ld, NULL, NULL); return (-1); } else