]> git.sur5r.net Git - openldap/commitdiff
Destroy Backend/Overlay after an error happend during one of the
authorRalf Haferkamp <ralf@openldap.org>
Tue, 5 Jul 2005 11:17:25 +0000 (11:17 +0000)
committerRalf Haferkamp <ralf@openldap.org>
Tue, 5 Jul 2005 11:17:25 +0000 (11:17 +0000)
config_parse_add() calls, as backend_db_init() might have been called.

servers/slapd/bconfig.c

index c654fff9f0ae23da37b46934b18a108d32899009..622e7e60114f78d3e3f6765c2d600bcbc00598d0 100644 (file)
@@ -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;