mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Error checking code for ITS#2367
This commit is contained in:
parent
0d0d5ffddf
commit
c1da85eba0
@ -44,7 +44,7 @@
|
|||||||
} \
|
} \
|
||||||
} while ( 0 )
|
} while ( 0 )
|
||||||
|
|
||||||
static int
|
int
|
||||||
bdb_idl_entry_cmp( const void *v_idl1, const void *v_idl2 )
|
bdb_idl_entry_cmp( const void *v_idl1, const void *v_idl2 )
|
||||||
{
|
{
|
||||||
const bdb_idl_cache_entry_t *idl1 = v_idl1, *idl2 = 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;
|
int i = 0;
|
||||||
while ( bdb->bi_idl_lru_tail != NULL && i < 10 ) {
|
while ( bdb->bi_idl_lru_tail != NULL && i < 10 ) {
|
||||||
ee = bdb->bi_idl_lru_tail;
|
ee = bdb->bi_idl_lru_tail;
|
||||||
avl_delete( &bdb->bi_idl_tree, (caddr_t) ee,
|
if ( avl_delete( &bdb->bi_idl_tree, (caddr_t) ee,
|
||||||
bdb_idl_entry_cmp );
|
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 );
|
IDL_LRU_DELETE( bdb, ee );
|
||||||
i++;
|
i++;
|
||||||
--bdb->bi_idl_cache_size;
|
--bdb->bi_idl_cache_size;
|
||||||
@ -551,8 +561,18 @@ bdb_idl_insert_key(
|
|||||||
matched_idl_entry = avl_find( bdb->bi_idl_tree, &idl_tmp,
|
matched_idl_entry = avl_find( bdb->bi_idl_tree, &idl_tmp,
|
||||||
bdb_idl_entry_cmp );
|
bdb_idl_entry_cmp );
|
||||||
if ( matched_idl_entry != NULL ) {
|
if ( matched_idl_entry != NULL ) {
|
||||||
avl_delete( &bdb->bi_idl_tree, (caddr_t) matched_idl_entry,
|
if ( avl_delete( &bdb->bi_idl_tree, (caddr_t) matched_idl_entry,
|
||||||
bdb_idl_entry_cmp );
|
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;
|
--bdb->bi_idl_cache_size;
|
||||||
IDL_LRU_DELETE( bdb, matched_idl_entry );
|
IDL_LRU_DELETE( bdb, matched_idl_entry );
|
||||||
free( matched_idl_entry->kstr.bv_val );
|
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,
|
matched_idl_entry = avl_find( bdb->bi_idl_tree, &idl_tmp,
|
||||||
bdb_idl_entry_cmp );
|
bdb_idl_entry_cmp );
|
||||||
if ( matched_idl_entry != NULL ) {
|
if ( matched_idl_entry != NULL ) {
|
||||||
avl_delete( &bdb->bi_idl_tree, (caddr_t) matched_idl_entry,
|
if ( avl_delete( &bdb->bi_idl_tree, (caddr_t) matched_idl_entry,
|
||||||
bdb_idl_entry_cmp );
|
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;
|
--bdb->bi_idl_cache_size;
|
||||||
IDL_LRU_DELETE( bdb, matched_idl_entry );
|
IDL_LRU_DELETE( bdb, matched_idl_entry );
|
||||||
free( matched_idl_entry->kstr.bv_val );
|
free( matched_idl_entry->kstr.bv_val );
|
||||||
|
Loading…
Reference in New Issue
Block a user