]> git.sur5r.net Git - openldap/commitdiff
ITS#7414 fix slapo-rwm modrdn cleanup
authorHoward Chu <hyc@openldap.org>
Thu, 11 Oct 2012 14:59:06 +0000 (07:59 -0700)
committerHoward Chu <hyc@openldap.org>
Thu, 11 Oct 2012 14:59:06 +0000 (07:59 -0700)
newSup is NULL if it was specified, but same as old Sup.

servers/slapd/overlays/rwm.c

index cc6211ed2508d4084d84e088afea42fe18a5471a..d12fd0f82f1aa441de6e9974e5bae67449195ea2 100644 (file)
@@ -107,10 +107,12 @@ rwm_op_rollback( Operation *op, SlapReply *rs, rwm_op_state *ros )
                break;
        case LDAP_REQ_MODRDN:
                if ( op->orr_newSup != ros->orr_newSup ) {
-                       ch_free( op->orr_newSup->bv_val );
-                       ch_free( op->orr_nnewSup->bv_val );
-                       op->o_tmpfree( op->orr_newSup, op->o_tmpmemctx );
-                       op->o_tmpfree( op->orr_nnewSup, op->o_tmpmemctx );
+                       if ( op->orr_newSup ) {
+                               ch_free( op->orr_newSup->bv_val );
+                               ch_free( op->orr_nnewSup->bv_val );
+                               op->o_tmpfree( op->orr_newSup, op->o_tmpmemctx );
+                               op->o_tmpfree( op->orr_nnewSup, op->o_tmpmemctx );
+                       }
                        op->orr_newSup = ros->orr_newSup;
                        op->orr_nnewSup = ros->orr_nnewSup;
                }