From: Ralf Haferkamp Date: Tue, 5 Jul 2005 11:17:25 +0000 (+0000) Subject: Destroy Backend/Overlay after an error happend during one of the X-Git-Tag: OPENLDAP_AC_BP~449 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=70276098189b56e8ebc3f2ec6e052e6fd92f2345;p=openldap Destroy Backend/Overlay after an error happend during one of the config_parse_add() calls, as backend_db_init() might have been called. --- diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index c654fff9f0..622e7e6011 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -3173,10 +3173,6 @@ ok: Debug(LDAP_DEBUG_ANY, "%s: %s (%s)!\n", ca->log, ca->msg, ca->argv[1] ); rc = LDAP_OTHER; - if ( colst[0]->co_type == Cft_Database ) - backend_destroy_one( ca->be ); - else - overlay_destroy_one( ca->be, (slap_overinst *)ca->bi ); goto leave; } } @@ -3202,6 +3198,14 @@ ok: } leave: + if ( rc ) { + if ( (colst[0]->co_type == Cft_Database) && ca->be ) { + backend_destroy_one( ca->be ); + } else if ( (colst[0]->co_type == Cft_Database) && ca->bi ) { + overlay_destroy_one( ca->be, (slap_overinst *)ca->bi ); + } + } + ch_free( ca->argv ); if ( colst ) ch_free( colst ); return rc;