diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2011-04-28 17:21:32 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-04-28 13:20:01 -0400 |
commit | 8c7e6e71b435857802f12c8de09d34b052880eb6 (patch) | |
tree | 905f30c7b52872cc6e2a0e99700cec76ff866ec3 /src/providers/ldap | |
parent | 333b7970cc60c6277363c80564456a716c2d6634 (diff) | |
download | sssd-8c7e6e71b435857802f12c8de09d34b052880eb6.tar.gz sssd-8c7e6e71b435857802f12c8de09d34b052880eb6.tar.xz sssd-8c7e6e71b435857802f12c8de09d34b052880eb6.zip |
Do not leak LDAP paging controls
Diffstat (limited to 'src/providers/ldap')
-rw-r--r-- | src/providers/ldap/sdap_async.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c index 5e05cb742..1e083553d 100644 --- a/src/providers/ldap/sdap_async.c +++ b/src/providers/ldap/sdap_async.c @@ -921,6 +921,8 @@ static errno_t sdap_get_generic_step(struct tevent_req *req) state->scope, state->filter, discard_const(state->attrs), false, m_controls, NULL, NULL, 0, &msgid); + ldap_control_free(page_control); + m_controls[0] = NULL; if (lret != LDAP_SUCCESS) { DEBUG(3, ("ldap_search_ext failed: %s\n", ldap_err2string(lret))); if (lret == LDAP_SERVER_DOWN) { @@ -1038,6 +1040,7 @@ static void sdap_get_generic_done(struct sdap_op *op, lret = ldap_parse_pageresponse_control(state->sh->ldap, page_control, &total_count, &cookie); + ldap_controls_free(returned_controls); if (lret != LDAP_SUCCESS) { DEBUG(1, ("Could not determine page control")); tevent_req_error(req, EIO); @@ -1068,6 +1071,8 @@ static void sdap_get_generic_done(struct sdap_op *op, return; } + /* The cookie must be freed even if len == 0 */ + ber_memfree(cookie.bv_val); /* This was the last page. We're done */ |