]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/bconfig.c
Plug leaks
[openldap] / servers / slapd / bconfig.c
index 59ffcdd0e3a979f203b637d59024b216368ebe60..baa42e446c57c2e55e07e7b6744432815ab185fb 100644 (file)
@@ -3871,6 +3871,8 @@ config_rename_one( Operation *op, SlapReply *rs, Entry *e,
                op->o_callback = ≻
                op->orr_newrdn = *newrdn;
                op->orr_nnewrdn = *nnewrdn;
+               op->orr_newSup = NULL;
+               op->orr_nnewSup = NULL;
                op->orr_deleteoldrdn = 1;
                op->orr_modlist = NULL;
                slap_modrdn2mods( op, rs );
@@ -3994,6 +3996,10 @@ check_name_index( CfEntryInfo *parent, ConfigType ce_type, Entry *e,
                if ( ce->ce_type == ce_type ) nsibs++;
        }
 
+       /* account for -1 frontend */
+       if ( ce_type == Cft_Database )
+               nsibs--;
+
        if ( index != nsibs ) {
                if ( gotindex ) {
                        if ( index < nsibs ) {
@@ -4005,8 +4011,6 @@ check_name_index( CfEntryInfo *parent, ConfigType ce_type, Entry *e,
                }
                if ( !isfrontend && index == -1 ) {
                        index = nsibs;
-                       if ( ce_type == Cft_Database )
-                               index--;
                }
 
                /* just make index = nsibs */
@@ -4799,7 +4803,8 @@ config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs,
                                        ca->valx = d->idx[i];
                                        rc = config_del_vals( ct, ca );
                                        if ( rc != LDAP_SUCCESS ) break;
-                                       s->a_flags |= SLAP_ATTR_IXDEL;
+                                       if ( s )
+                                               s->a_flags |= SLAP_ATTR_IXDEL;
                                        for (j=i+1; j < d->nidx; j++)
                                                if ( d->idx[j] >d->idx[i] )
                                                        d->idx[j]--;
@@ -4809,7 +4814,8 @@ config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs,
                                ca->line = NULL;
                                rc = config_del_vals( ct, ca );
                                if ( rc ) rc = LDAP_OTHER;
-                               s->a_flags |= SLAP_ATTR_IXDEL;
+                               if ( s )
+                                       s->a_flags |= SLAP_ATTR_IXDEL;
                        }
                        if ( ml->sml_values ) {
                                d = d->next;
@@ -5239,6 +5245,9 @@ int config_entry_release(
        Entry *e,
        int rw )
 {
+       if ( !e->e_private ) {
+               entry_free( e );
+       }
        return LDAP_SUCCESS;
 }