From b0a01cfbc2d0a5e8ec1135a82c82ca882963df75 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Tue, 25 Jul 2000 01:24:47 +0000 Subject: [PATCH] ITS#636, keys == NULL bug plus plug leak when keys != NULL --- servers/slapd/back-ldbm/index.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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 ); } } -- 2.39.5