From 6b4de966791064007c27a375b3068e9a1bb196bb Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 9 May 2006 10:52:22 +0000 Subject: [PATCH] plug leak --- servers/slapd/back-sql/schema-map.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/servers/slapd/back-sql/schema-map.c b/servers/slapd/back-sql/schema-map.c index 3ecdcdfaa2..6f47ce96aa 100644 --- a/servers/slapd/back-sql/schema-map.c +++ b/servers/slapd/back-sql/schema-map.c @@ -319,6 +319,7 @@ backsql_oc_get_attr_mapping( void *v_oc, void *v_bas ) const char *text = NULL; struct berval bv; struct berbuf bb = BB_NULL; + AttributeDescription *ad = NULL; Debug( LDAP_DEBUG_TRACE, "attributeType:\n" @@ -336,10 +337,7 @@ backsql_oc_get_attr_mapping( void *v_oc, void *v_bas ) /* TimesTen */ Debug( LDAP_DEBUG_TRACE, "\tsel_expr_u=\"%s\"\n", at_row.cols[ 8 ], 0, 0 ); - at_map = (backsql_at_map_rec *)ch_calloc( 1, - sizeof( backsql_at_map_rec ) ); - rc = slap_str2ad( at_row.cols[ 0 ], - &at_map->bam_ad, &text ); + rc = slap_str2ad( at_row.cols[ 0 ], &ad, &text ); if ( rc != LDAP_SUCCESS ) { Debug( LDAP_DEBUG_TRACE, "backsql_oc_get_attr_mapping(): " "attribute \"%s\" for objectClass \"%s\" " @@ -349,6 +347,9 @@ backsql_oc_get_attr_mapping( void *v_oc, void *v_bas ) bas->bas_rc = LDAP_CONSTRAINT_VIOLATION; return BACKSQL_AVL_STOP; } + at_map = (backsql_at_map_rec *)ch_calloc( 1, + sizeof( backsql_at_map_rec ) ); + at_map->bam_ad = ad; ber_str2bv( at_row.cols[ 1 ], 0, 1, &at_map->bam_sel_expr ); if ( at_row.value_len[ 8 ] < 0 ) { -- 2.39.5