From: Howard Chu Date: Thu, 14 Sep 2006 00:09:46 +0000 (+0000) Subject: Forgot the OC delete handler X-Git-Tag: OPENLDAP_REL_ENG_2_3_MP~154 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=543ae473c55705fc9105c5bfb547d22b147bd122;p=openldap Forgot the OC delete handler --- diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index da5986fc58..3b2c0cedda 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -1114,6 +1114,33 @@ config_generic(ConfigArgs *c) { if ( ce->ce_parent->ce_type == Cft_Global ) return 1; } + cfn = c->private; + if ( c->valx < 0 ) { + ObjectClass *oc; + + for( oc = cfn->c_oc_head; oc; oc_next( &oc )) { + oc_delete( oc ); + if ( oc == cfn->c_oc_tail ) + break; + } + cfn->c_oc_head = cfn->c_oc_tail = NULL; + } else { + ObjectClass *oc, *prev = NULL; + int i; + + for ( i=0, oc=cfn->c_oc_head; ivalx; i++) { + prev = oc; + oc_next( &oc ); + } + oc_delete( oc ); + if ( cfn->c_oc_tail == oc ) { + cfn->c_oc_tail = prev; + } + if ( cfn->c_oc_head == oc ) { + oc_next( &oc ); + cfn->c_oc_head = oc; + } + } break; case CFG_ATTR: {