[SSSD] [PATCH] Check LDAP structure before calling ldap_unbind_ext()

Sumit Bose sbose at redhat.com
Wed Dec 2 20:34:50 UTC 2009


Hi,

sdap_handle_release() runs through the existing operations before
unbinding from the LDAP server. But some of the operations might have
called sdap_handle_release(), too, and the LDAP structure is not valid
anymore. To avoid an error in the LDAP libraries we check the structure
before calling ldap_unbind_ext().

bye,
Sumit

-------------- next part --------------
From 66622f8291d1ef1602b5e25fde286968aa28235f Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Wed, 2 Dec 2009 21:26:37 +0100
Subject: [PATCH] Check LDAP structure before calling ldap_unbind_ext()

---
 server/providers/ldap/sdap_async.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/server/providers/ldap/sdap_async.c b/server/providers/ldap/sdap_async.c
index 5a90339..fd9b4ba 100644
--- a/server/providers/ldap/sdap_async.c
+++ b/server/providers/ldap/sdap_async.c
@@ -107,7 +107,9 @@ static void sdap_handle_release(struct sdap_handle *sh)
             if (op == sh->ops) talloc_free(op);
         }
 
-        ldap_unbind_ext(sh->ldap, NULL, NULL);
+        if (sh->ldap) {
+            ldap_unbind_ext(sh->ldap, NULL, NULL);
+        }
         sh->connected = false;
         sh->ldap = NULL;
         sh->ops = NULL;
-- 
1.6.5.2



More information about the sssd-devel mailing list