s4/ildap: fine tune ildb_callback()
authorKamen Mazdrashki <kamen.mazdrashki@postpath.com>
Wed, 3 Mar 2010 00:33:31 +0000 (02:33 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 3 Mar 2010 02:18:38 +0000 (13:18 +1100)
Actually ildb_context pointer is not supposed to be
valid after calling ildb_request_done().
This is due to the fact that when calling ildb_request_done()
caller will (most probably) free any locally built
ldap_request objects - thus rendering ildb_context invalid.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
source4/lib/ldb/ldb_ildap/ldb_ildap.c

index 3110008c9fb2380aee0866c417df220657aed184..9f81c4e534841d10f9b2d169aa43b60bf39d1ce0 100644 (file)
@@ -383,13 +383,13 @@ static void ildb_callback(struct ldap_request *req)
                }
        }
 
                }
        }
 
+       /* mark the request as not being in progress */
+       ac->in_ildb_callback = false;
+
        if (request_done) {
                ildb_request_done(ac, controls, ret);
        }
 
        if (request_done) {
                ildb_request_done(ac, controls, ret);
        }
 
-       /* unmark the request as beign in progress */
-       ac->in_ildb_callback = false;
-
        return;
 }
 
        return;
 }