]> git.sur5r.net Git - openldap/commitdiff
plug modrdn memleaks
authorHoward Chu <hyc@openldap.org>
Sat, 27 Sep 2003 07:52:20 +0000 (07:52 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 27 Sep 2003 07:52:20 +0000 (07:52 +0000)
servers/slapd/back-ldbm/modify.c
servers/slapd/back-ldbm/modrdn.c

index 290f29c02f0254d0ddee91b1fdff7ee20c8162fa..5679f2dadc7ef110b4f8bafc5da45ea28c2f147c 100644 (file)
@@ -153,6 +153,7 @@ int ldbm_modify_internal(
 
                        rc = modify_add_values( e, mod, get_permissiveModify( op ),
                                                text, textbuf, textlen );
+                       mod->sm_op = SLAP_MOD_SOFTADD;
                        if ( rc == LDAP_TYPE_OR_VALUE_EXISTS ) {
                                rc = LDAP_SUCCESS;
                        }
index 4a415061510db35d1713cb272801ad11f557835d..99440e9d4545d5f2666c51cc5d602a1324e13cb2 100644 (file)
@@ -655,10 +655,16 @@ return_results:
        if ( mod != NULL ) {
                Modifications *tmp;
                for (; mod; mod = tmp ) {
+                       /* slap_modrdn2mods does things one way,
+                        * slap_mods_opattrs does it differently
+                        */
+                       if ( mod->sml_op != SLAP_MOD_SOFTADD &&
+                               mod->sml_op != LDAP_MOD_DELETE ) break;
                        if ( mod->sml_nvalues ) free( mod->sml_nvalues[0].bv_val );
                        tmp = mod->sml_next;
                        free( mod );
                }
+               slap_mods_free( mod );
        }
 
        /* LDAP v3 Support */