From: Pierangelo Masarati Date: Sun, 7 Aug 2005 18:56:19 +0000 (+0000) Subject: more cleanup X-Git-Tag: OPENLDAP_AC_BP~68 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=125059ccb553b071f0c1fef349e66040e8090123;p=openldap more cleanup --- diff --git a/servers/slapd/back-sql/init.c b/servers/slapd/back-sql/init.c index cf1c798cd3..a2e6f5948f 100644 --- a/servers/slapd/back-sql/init.c +++ b/servers/slapd/back-sql/init.c @@ -473,7 +473,17 @@ backsql_db_open( "connection failed, exiting\n", 0, 0, 0 ); return 1; } - (void)backsql_free_db_conn( op ); + + if ( backsql_free_db_conn( op ) != SQL_SUCCESS ) { + Debug( LDAP_DEBUG_TRACE, "backsql_db_open(): " + "connection free failed\n", 0, 0, 0 ); + } + if ( !BACKSQL_SCHEMA_LOADED( bi ) ) { + Debug( LDAP_DEBUG_TRACE, "backsql_db_open(): " + "test failed, schema map not loaded - exiting\n", + 0, 0, 0 ); + return 1; + } /* * Prepare ID selection query @@ -532,14 +542,6 @@ backsql_db_open( &bi->sql_aliasing_quote, "dn", &bi->sql_aliasing_quote ); bi->sql_dn_oc_aliasing = bb.bb_val; - backsql_free_db_conn( op ); - if ( !BACKSQL_SCHEMA_LOADED( bi ) ) { - Debug( LDAP_DEBUG_TRACE, "backsql_db_open(): " - "test failed, schema map not loaded - exiting\n", - 0, 0, 0 ); - return 1; - } - /* should never happen! */ assert( bd->be_nsuffix != NULL ); diff --git a/servers/slapd/back-sql/sql-wrap.c b/servers/slapd/back-sql/sql-wrap.c index 8173d50468..5b3cf662d8 100644 --- a/servers/slapd/back-sql/sql-wrap.c +++ b/servers/slapd/back-sql/sql-wrap.c @@ -417,11 +417,14 @@ backsql_free_db_conn( Operation *op ) */ if ( conn != NULL ) { Debug( LDAP_DEBUG_TRACE, "backsql_free_db_conn(): " - "closing db connection\n", 0, 0, 0 ); + "closing db connection %lu (%p)\n", + op->o_connid, conn, 0 ); backsql_close_db_conn( conn ); } + Debug( LDAP_DEBUG_TRACE, "<==backsql_free_db_conn()\n", 0, 0, 0 ); - return SQL_SUCCESS; + + return conn ? SQL_SUCCESS : SQL_ERROR; } int