]> git.sur5r.net Git - openldap/commitdiff
Check op->o_bd != NULL
authorLuke Howard <lukeh@openldap.org>
Tue, 19 Jul 2005 08:40:26 +0000 (08:40 +0000)
committerLuke Howard <lukeh@openldap.org>
Tue, 19 Jul 2005 08:40:26 +0000 (08:40 +0000)
servers/slapd/backend.c

index 950c2f55be9ff4d453b04671b026499e43d8092f..8734fed4ce18f5b3e6c7902ec3dbe012b96db7b0 100644 (file)
@@ -1751,17 +1751,20 @@ int backend_operational(
                ap = &(*ap)->a_next;
        }
 
-       /* Let the overlays have a chance at this */
-       be_orig = op->o_bd;
-       if ( SLAP_ISOVERLAY( be_orig ) )
-               op->o_bd = select_backend( be_orig->be_nsuffix, 0, 0 );
-
-       if ( ( SLAP_OPATTRS( rs->sr_attr_flags ) || rs->sr_attrs ) &&
-               op->o_bd && op->o_bd->be_operational != NULL )
+       if ( op->o_bd != NULL )
        {
-               rc = op->o_bd->be_operational( op, rs );
+               /* Let the overlays have a chance at this */
+               be_orig = op->o_bd;
+               if ( SLAP_ISOVERLAY( be_orig ) )
+                       op->o_bd = select_backend( be_orig->be_nsuffix, 0, 0 );
+
+               if ( ( SLAP_OPATTRS( rs->sr_attr_flags ) || rs->sr_attrs ) &&
+                       op->o_bd && op->o_bd->be_operational != NULL )
+               {
+                       rc = op->o_bd->be_operational( op, rs );
+               }
+               op->o_bd = be_orig;
        }
-       op->o_bd = be_orig;
 
        return rc;
 }