]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Cache pool_inst so if binding/reconnecting fails we still have access to it
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 1 Dec 2016 02:42:26 +0000 (21:42 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 1 Dec 2016 02:42:26 +0000 (21:42 -0500)
src/modules/rlm_ldap/ldap.c

index dd5754aeb8a1cd29f4e9f5d4e560252ac8f6d01f..d01b495836940948f432b118f9838f1607348623 100644 (file)
@@ -831,6 +831,7 @@ ldap_rcode_t rlm_ldap_bind(rlm_ldap_t const *inst,
                           LDAPControl **serverctrls, LDAPControl **clientctrls)
 {
        ldap_rcode_t            status = LDAP_PROC_ERROR;
+       ldap_pool_inst_t        *pool_inst = (*pconn)->pool_inst;
 
        int                     msgid = -1;
 
@@ -922,7 +923,7 @@ ldap_rcode_t rlm_ldap_bind(rlm_ldap_t const *inst,
                                if (*pconn) {
                                        ROPTIONAL(RWDEBUG, WARN, "Bind with %s to %s failed: %s. Got new socket, "
                                                  "retrying...", *dn ? dn : "(anonymous)",
-                                                 (*pconn)->pool_inst->server, error);
+                                                 pool_inst->server, error);
 
                                        talloc_free(extra); /* don't leak debug info */
 
@@ -938,7 +939,7 @@ ldap_rcode_t rlm_ldap_bind(rlm_ldap_t const *inst,
                        /* FALL-THROUGH */
                default:
                        ROPTIONAL(REDEBUG, ERROR, "Bind with %s to %s failed: %s", *dn ? dn : "(anonymous)",
-                                 (*pconn)->pool_inst->server, error);
+                                 pool_inst->server, error);
                        LDAP_EXTRA_DEBUG();
 
                        break;