]> git.sur5r.net Git - openldap/commitdiff
ITS#7687: password modify can muck with controls (quick fix)
authorPierangelo Masarati <ando@OpenLDAP.org>
Tue, 10 Sep 2013 19:58:28 +0000 (21:58 +0200)
committerPierangelo Masarati <ando@OpenLDAP.org>
Tue, 10 Sep 2013 20:03:32 +0000 (22:03 +0200)
servers/slapd/back-ldap/chain.c

index d2e3e2441a2f22b39e37762c9e44f9c2186a3089..3ecc3b673c359282a3f651a11326ba8d0ea99f65 100644 (file)
@@ -196,12 +196,13 @@ chaining_control_remove(
         * added by the chain overlay, so it's the only one we explicitly 
         * free */
        if ( op->o_ctrls != oldctrls ) {
-               assert( op->o_ctrls != NULL );
-               assert( op->o_ctrls[ 0 ] != NULL );
+               if ( op->o_ctrls != NULL ) {
+                       assert( op->o_ctrls[ 0 ] != NULL );
 
-               free( op->o_ctrls );
+                       free( op->o_ctrls );
 
-               op->o_chaining = 0;
+                       op->o_chaining = 0;
+               }
                op->o_ctrls = oldctrls;
        }