summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-11-11 10:04:53 -0500
committerStephen Gallagher <sgallagh@redhat.com>2009-11-12 11:00:49 -0500
commitec1fe05f728d3db402bdb0cb6bb99cc4e76cb806 (patch)
treef885f8f479b6d187e7739057ea8a2d230f09cfe5
parentf87584a07661e1501904d6fb842c47888757f223 (diff)
downloadsssd-ec1fe05f728d3db402bdb0cb6bb99cc4e76cb806.tar.gz
sssd-ec1fe05f728d3db402bdb0cb6bb99cc4e76cb806.tar.bz2
sssd-ec1fe05f728d3db402bdb0cb6bb99cc4e76cb806.zip
Fix double free case.
-rw-r--r--server/providers/ldap/sdap_async.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/providers/ldap/sdap_async.c b/server/providers/ldap/sdap_async.c
index 9e35c643..99d82979 100644
--- a/server/providers/ldap/sdap_async.c
+++ b/server/providers/ldap/sdap_async.c
@@ -102,7 +102,9 @@ static void sdap_handle_release(struct sdap_handle *sh)
while (sh->ops) {
op = sh->ops;
op->callback(op, NULL, EIO, op->data);
- talloc_free(op);
+ /* calling the callback may result in freeing the op */
+ /* check if it is still the same or avoid freeing */
+ if (op == sh->ops) talloc_free(op);
}
ldap_unbind_ext(sh->ldap, NULL, NULL);