From 6930e84f812fc9f30e7d4f123bb5409a94d4f307 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 6 Dec 2005 22:56:58 +0000 Subject: [PATCH] plug leaks... --- servers/slapd/back-sql/entry-id.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/servers/slapd/back-sql/entry-id.c b/servers/slapd/back-sql/entry-id.c index 9d33b9df72..300f2af4c0 100644 --- a/servers/slapd/back-sql/entry-id.c +++ b/servers/slapd/back-sql/entry-id.c @@ -648,6 +648,11 @@ backsql_get_attr_vals( void *v_at, void *v_bsi ) Debug( LDAP_DEBUG_TRACE, "backsql_get_attr_vals(): " "error preparing query: %s\n", at->bam_query, 0, 0 ); backsql_PrintErrors( bi->sql_db_env, bsi->bsi_dbh, sth, rc ); +#ifdef BACKSQL_COUNTQUERY + if ( append ) { + attr_free( attr ); + } +#endif /* BACKSQL_COUNTQUERY */ return 1; } @@ -656,6 +661,11 @@ backsql_get_attr_vals( void *v_at, void *v_bsi ) if ( rc != SQL_SUCCESS ) { Debug( LDAP_DEBUG_TRACE, "backsql_get_attr_vals(): " "error binding key value parameter\n", 0, 0, 0 ); +#ifdef BACKSQL_COUNTQUERY + if ( append ) { + attr_free( attr ); + } +#endif /* BACKSQL_COUNTQUERY */ return 1; } @@ -678,6 +688,11 @@ backsql_get_attr_vals( void *v_at, void *v_bsi ) at->bam_query, 0, 0 ); backsql_PrintErrors( bi->sql_db_env, bsi->bsi_dbh, sth, rc ); SQLFreeStmt( sth, SQL_DROP ); +#ifdef BACKSQL_COUNTQUERY + if ( append ) { + attr_free( attr ); + } +#endif /* BACKSQL_COUNTQUERY */ return 1; } -- 2.39.5