From: Kurt Zeilenga Date: Tue, 25 Jul 2000 01:24:47 +0000 (+0000) Subject: ITS#636, keys == NULL bug X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2357 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b0a01cfbc2d0a5e8ec1135a82c82ca882963df75;p=openldap ITS#636, keys == NULL bug plus plug leak when keys != NULL --- diff --git a/servers/slapd/back-ldbm/index.c b/servers/slapd/back-ldbm/index.c index 0d93e525ea..db9f264fc2 100644 --- a/servers/slapd/back-ldbm/index.c +++ b/servers/slapd/back-ldbm/index.c @@ -174,10 +174,11 @@ static int indexer( ad->ad_type->sat_equality, &prefix, vals, &keys ); - if( rc == LDAP_SUCCESS ) { - for( i= 0; keys[i] != NULL; i++ ) { + if( rc == LDAP_SUCCESS && keys != NULL ) { + for( i=0; keys[i] != NULL; i++ ) { key_change( be, db, keys[i], id, op ); } + ber_bvecfree( keys ); } } @@ -188,10 +189,11 @@ static int indexer( ad->ad_type->sat_approx, &prefix, vals, &keys ); - if( rc == LDAP_SUCCESS ) { - for( i= 0; keys[i] != NULL; i++ ) { + if( rc == LDAP_SUCCESS && keys != NULL ) { + for( i=0; keys[i] != NULL; i++ ) { key_change( be, db, keys[i], id, op ); } + ber_bvecfree( keys ); } } @@ -202,10 +204,11 @@ static int indexer( ad->ad_type->sat_substr, &prefix, vals, &keys ); - if( rc == LDAP_SUCCESS ) { - for( i= 0; keys[i] != NULL; i++ ) { + if( rc == LDAP_SUCCESS && keys != NULL ) { + for( i=0; keys[i] != NULL; i++ ) { key_change( be, db, keys[i], id, op ); } + ber_bvecfree( keys ); } }