From ec1fe05f728d3db402bdb0cb6bb99cc4e76cb806 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 11 Nov 2009 10:04:53 -0500 Subject: Fix double free case. --- server/providers/ldap/sdap_async.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server/providers/ldap') diff --git a/server/providers/ldap/sdap_async.c b/server/providers/ldap/sdap_async.c index 9e35c6432..99d829794 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); -- cgit