From: Marc Fournier Date: Mon, 30 Jun 2014 14:42:54 +0000 (+0200) Subject: openldap: fix leak when reading from server fails X-Git-Tag: collectd-5.5.0~152^2~21 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2e6bc30fc70622077b594322b1c02081a095ea04;p=collectd.git openldap: fix leak when reading from server fails --- diff --git a/src/openldap.c b/src/openldap.c index 166dcec3..f284a191 100644 --- a/src/openldap.c +++ b/src/openldap.c @@ -328,6 +328,7 @@ static int 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); return (-1); } } @@ -342,6 +343,7 @@ static int 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); return (-1); } else