summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/sdap_async_connection.c
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2010-04-29 12:30:05 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-05-03 13:52:10 -0400
commit270a0a1b6182ef1fbff2a93af6731788cf954874 (patch)
treecedb35b32d4f4d22c6cf20905061d6fd58887cea /src/providers/ldap/sdap_async_connection.c
parent68796aa0ae2641e2bfe5fe10a703bc705d10e9d4 (diff)
downloadsssd-270a0a1b6182ef1fbff2a93af6731788cf954874.tar.gz
sssd-270a0a1b6182ef1fbff2a93af6731788cf954874.tar.xz
sssd-270a0a1b6182ef1fbff2a93af6731788cf954874.zip
Better handle sdap_handle memory from callers.
Always just mark the sdap_handle as not connected and let later _send() functions to take care of freeing the handle before reconnecting. Introduce restart functions to avoid calling _send() functions in _done() functions error paths as this would have the same effect as directly freeing the sdap_handle and cause access to freed memory in sdap_handle_release() By freeing sdap_handle only in the connection _recv() function we guarantee it can never be done within sdap_handle_release() but only in a following event.
Diffstat (limited to 'src/providers/ldap/sdap_async_connection.c')
-rw-r--r--src/providers/ldap/sdap_async_connection.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c
index 9871dc210..ec36a6018 100644
--- a/src/providers/ldap/sdap_async_connection.c
+++ b/src/providers/ldap/sdap_async_connection.c
@@ -1119,6 +1119,9 @@ int sdap_cli_connect_recv(struct tevent_req *req,
}
if (gsh) {
+ if (*gsh) {
+ talloc_zfree(*gsh);
+ }
*gsh = talloc_steal(memctx, state->sh);
if (!*gsh) {
return ENOMEM;