From: Howard Chu Date: Tue, 9 May 2006 10:52:22 +0000 (+0000) Subject: plug leak X-Git-Tag: OPENLDAP_REL_ENG_2_4_1ALPHA~2^2~66 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6b4de966791064007c27a375b3068e9a1bb196bb;p=openldap plug leak --- 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 ) {