summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/providers/ldap/sdap_async.c3
-rw-r--r--src/providers/ldap/sdap_async_connection.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c
index 7fc04a64..84da288a 100644
--- a/src/providers/ldap/sdap_async.c
+++ b/src/providers/ldap/sdap_async.c
@@ -863,7 +863,7 @@ static void sdap_get_generic_done(struct sdap_op *op,
struct sdap_get_generic_state *state = tevent_req_data(req,
struct sdap_get_generic_state);
struct sysdb_attrs *attrs;
- char *errmsg;
+ char *errmsg = NULL;
int result;
int ret;
@@ -917,6 +917,7 @@ static void sdap_get_generic_done(struct sdap_op *op,
DEBUG(2, ("Unexpected result from ldap: %s(%d), %s\n",
ldap_err2string(result), result, errmsg));
}
+ ldap_memfree(errmsg);
tevent_req_done(req);
return;
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c
index e4ca9624..f73f34e1 100644
--- a/src/providers/ldap/sdap_async_connection.c
+++ b/src/providers/ldap/sdap_async_connection.c
@@ -238,7 +238,7 @@ static void sdap_connect_done(struct sdap_op *op,
struct tevent_req *req = talloc_get_type(pvt, struct tevent_req);
struct sdap_connect_state *state = tevent_req_data(req,
struct sdap_connect_state);
- char *errmsg;
+ char *errmsg = NULL;
char *tlserr;
int ret;
int optret;
@@ -260,6 +260,7 @@ static void sdap_connect_done(struct sdap_op *op,
DEBUG(3, ("START TLS result: %s(%d), %s\n",
ldap_err2string(state->result), state->result, errmsg));
+ ldap_memfree(errmsg);
if (ldap_tls_inplace(state->sh->ldap)) {
DEBUG(9, ("SSL/TLS handler already in place.\n"));
@@ -420,7 +421,7 @@ static void simple_bind_done(struct sdap_op *op,
struct tevent_req *req = talloc_get_type(pvt, struct tevent_req);
struct simple_bind_state *state = tevent_req_data(req,
struct simple_bind_state);
- char *errmsg;
+ char *errmsg = NULL;
int ret;
LDAPControl **response_controls;
int c;
@@ -502,6 +503,7 @@ static void simple_bind_done(struct sdap_op *op,
ret = LDAP_SUCCESS;
done:
ldap_controls_free(response_controls);
+ ldap_memfree(errmsg);
if (ret == LDAP_SUCCESS) {
tevent_req_done(req);