]> git.sur5r.net Git - openldap/commitdiff
Fixed insertion of the overlay_remove callback (SLAP_CONFIG_DELETE)
authorRalf Haferkamp <ralf@openldap.org>
Mon, 19 Nov 2012 13:32:50 +0000 (14:32 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 26 Nov 2012 22:32:35 +0000 (14:32 -0800)
servers/slapd/backover.c

index 320b3385c01ef5402a63e90b6486c27dba8021cb..8a7e1ed99375818dc7fa6f4feaf97026e9fe792a 100644 (file)
@@ -1214,8 +1214,12 @@ overlay_remove( BackendDB *be, slap_overinst *on, Operation *op )
        rm_cb->sc_private = (void*) rm_ctx;
 
        /* Append callback to the end of the list */
-       for ( cb = op->o_callback; cb->sc_next; cb = cb->sc_next );
-       cb->sc_next = rm_cb;
+       if ( !op->o_callback ) {
+               op->o_callback = rm_cb;
+       } else {
+               for ( cb = op->o_callback; cb->sc_next; cb = cb->sc_next );
+               cb->sc_next = rm_cb;
+       }
 }
 #endif /* SLAP_CONFIG_DELETE */