From: Kurt Zeilenga Date: Wed, 28 Jul 1999 23:19:16 +0000 (+0000) Subject: Slightly better ITS#238 fix than last commit... has Debug X-Git-Tag: OPENLDAP_REL_ENG_2_BP~7 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=de8a1d518a78b1472f406d498263da9f6237583e;p=openldap Slightly better ITS#238 fix than last commit... has Debug message, doesn't bother to open/close index files... --- diff --git a/servers/slapd/back-bdb2/index.c b/servers/slapd/back-bdb2/index.c index 825a97e3bd..5e2a97ad32 100644 --- a/servers/slapd/back-bdb2/index.c +++ b/servers/slapd/back-bdb2/index.c @@ -231,6 +231,13 @@ bdb2i_index_add_values( char *at_cn; + if( vals == NULL ) { + Debug( LDAP_DEBUG_TRACE, + "=> bdb2i_index_add_values( \"%s\", NULL, %ld )\n", + type, id, 0 ); + return 0; + } + Debug( LDAP_DEBUG_TRACE, "=> bdb2i_index_add_values( \"%s\", %ld )\n", type, id, 0 ); attr_normalize( type ); @@ -248,8 +255,7 @@ bdb2i_index_add_values( return( -1 ); } - if( vals != NULL ) { - for ( i = 0; vals[i] != NULL; i++ ) { + for ( i = 0; vals[i] != NULL; i++ ) { /* * presence index entry */ @@ -341,7 +347,6 @@ bdb2i_index_add_values( if ( bigbuf != NULL ) { free( bigbuf ); } - } } bdb2i_cache_close( be, db ); diff --git a/servers/slapd/back-ldbm/index.c b/servers/slapd/back-ldbm/index.c index 88d279b888..1a3a468fc2 100644 --- a/servers/slapd/back-ldbm/index.c +++ b/servers/slapd/back-ldbm/index.c @@ -265,6 +265,13 @@ index_change_values( char *at_cn; /* Attribute canonical name */ int mode; + if( vals == NULL ) { + Debug( LDAP_DEBUG_TRACE, + "=> index_change_values( %s, NULL, %ld, op=%s )\n", + type, id, ((op == __INDEX_ADD_OP) ? "ADD" : "DELETE" ) ); + return 0; + } + Debug( LDAP_DEBUG_TRACE, "=> index_change_values( \"%s\", %ld, op=%s )\n", type, id, ((op == __INDEX_ADD_OP) ? "ADD" : "DELETE" ) ); @@ -306,8 +313,7 @@ index_change_values( } - if ( vals != NULL ) { - for ( i = 0; vals[i] != NULL; i++ ) { + for ( i = 0; vals[i] != NULL; i++ ) { /* * presence index entry */ @@ -417,7 +423,6 @@ index_change_values( if ( bigbuf != NULL ) { free( bigbuf ); } - } } ldbm_cache_close( be, db );