From: Pierangelo Masarati Date: Tue, 6 Dec 2005 22:56:58 +0000 (+0000) Subject: plug leaks... X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~635 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6930e84f812fc9f30e7d4f123bb5409a94d4f307;p=openldap plug leaks... --- 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; }