From 87258d6332fba7a71412fcca0671240fa3b43b21 Mon Sep 17 00:00:00 2001 From: Marc Fournier Date: Mon, 1 Sep 2014 13:26:38 +0200 Subject: [PATCH] openldap: properly free allocated resources on transient errors --- src/openldap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/openldap.c b/src/openldap.c index 4d8fa68f..5b9f8b14 100644 --- a/src/openldap.c +++ b/src/openldap.c @@ -69,6 +69,7 @@ static int ldap_init_host (ldap_t *st) /* {{{ */ ERROR ("openldap plugin: ldap_initialize failed: %s", ldap_err2string (rc)); st->state = 0; + ldap_unbind_ext_s (ld, NULL, NULL); return (-1); } @@ -210,6 +211,7 @@ static int ldap_read_host (user_data_t *ud) /* {{{ */ ERROR ("openldap plugin: Failed to execute search: %s", ldap_err2string (rc)); ldap_msgfree (result); + ldap_unbind_ext_s (st->ld, NULL, NULL); return (-1); } -- 2.30.2