mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 00:29:35 -05:00
Error checking code for ITS#2367
This commit is contained in:
parent
0d0d5ffddf
commit
c1da85eba0
1 changed files with 37 additions and 7 deletions
|
|
@ -44,7 +44,7 @@
|
|||
} \
|
||||
} while ( 0 )
|
||||
|
||||
static int
|
||||
int
|
||||
bdb_idl_entry_cmp( const void *v_idl1, const void *v_idl2 )
|
||||
{
|
||||
const bdb_idl_cache_entry_t *idl1 = v_idl1, *idl2 = v_idl2;
|
||||
|
|
@ -493,8 +493,18 @@ bdb_idl_fetch_key(
|
|||
int i = 0;
|
||||
while ( bdb->bi_idl_lru_tail != NULL && i < 10 ) {
|
||||
ee = bdb->bi_idl_lru_tail;
|
||||
avl_delete( &bdb->bi_idl_tree, (caddr_t) ee,
|
||||
bdb_idl_entry_cmp );
|
||||
if ( avl_delete( &bdb->bi_idl_tree, (caddr_t) ee,
|
||||
bdb_idl_entry_cmp ) == NULL ) {
|
||||
#ifdef NEW_LOGGING
|
||||
LDAP_LOG( INDEX, ERR,
|
||||
"bdb_idl_fetch_key: AVL delete failed\n",
|
||||
0, 0, 0 );
|
||||
#else
|
||||
Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
|
||||
"AVL delete failed\n",
|
||||
0, 0, 0 );
|
||||
#endif
|
||||
}
|
||||
IDL_LRU_DELETE( bdb, ee );
|
||||
i++;
|
||||
--bdb->bi_idl_cache_size;
|
||||
|
|
@ -551,8 +561,18 @@ bdb_idl_insert_key(
|
|||
matched_idl_entry = avl_find( bdb->bi_idl_tree, &idl_tmp,
|
||||
bdb_idl_entry_cmp );
|
||||
if ( matched_idl_entry != NULL ) {
|
||||
avl_delete( &bdb->bi_idl_tree, (caddr_t) matched_idl_entry,
|
||||
bdb_idl_entry_cmp );
|
||||
if ( avl_delete( &bdb->bi_idl_tree, (caddr_t) matched_idl_entry,
|
||||
bdb_idl_entry_cmp ) == NULL ) {
|
||||
#ifdef NEW_LOGGING
|
||||
LDAP_LOG( INDEX, ERR,
|
||||
"bdb_idl_fetch_key: AVL delete failed\n",
|
||||
0, 0, 0 );
|
||||
#else
|
||||
Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
|
||||
"AVL delete failed\n",
|
||||
0, 0, 0 );
|
||||
#endif
|
||||
}
|
||||
--bdb->bi_idl_cache_size;
|
||||
IDL_LRU_DELETE( bdb, matched_idl_entry );
|
||||
free( matched_idl_entry->kstr.bv_val );
|
||||
|
|
@ -763,8 +783,18 @@ bdb_idl_delete_key(
|
|||
matched_idl_entry = avl_find( bdb->bi_idl_tree, &idl_tmp,
|
||||
bdb_idl_entry_cmp );
|
||||
if ( matched_idl_entry != NULL ) {
|
||||
avl_delete( &bdb->bi_idl_tree, (caddr_t) matched_idl_entry,
|
||||
bdb_idl_entry_cmp );
|
||||
if ( avl_delete( &bdb->bi_idl_tree, (caddr_t) matched_idl_entry,
|
||||
bdb_idl_entry_cmp ) == NULL ) {
|
||||
#ifdef NEW_LOGGING
|
||||
LDAP_LOG( INDEX, ERR,
|
||||
"bdb_idl_fetch_key: AVL delete failed\n",
|
||||
0, 0, 0 );
|
||||
#else
|
||||
Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
|
||||
"AVL delete failed\n",
|
||||
0, 0, 0 );
|
||||
#endif
|
||||
}
|
||||
--bdb->bi_idl_cache_size;
|
||||
IDL_LRU_DELETE( bdb, matched_idl_entry );
|
||||
free( matched_idl_entry->kstr.bv_val );
|
||||
|
|
|
|||
Loading…
Reference in a new issue