EntryInfo *ei;
int free = 0;
- bdb_cache_entry_db_unlock( bdb, lock );
ei = e->e_private;
- bdb_cache_entryinfo_lock( ei );
- if ( ei->bei_state & CACHE_ENTRY_NOT_CACHED ) {
- ei->bei_e = NULL;
- ei->bei_state ^= CACHE_ENTRY_NOT_CACHED;
- free = 1;
+ bdb_cache_entry_db_unlock( bdb, lock );
+ if ( ei ) {
+ bdb_cache_entryinfo_lock( ei );
+ if ( ei->bei_state & CACHE_ENTRY_NOT_CACHED ) {
+ ei->bei_e = NULL;
+ ei->bei_state ^= CACHE_ENTRY_NOT_CACHED;
+ free = 1;
+ }
+ bdb_cache_entryinfo_unlock( ei );
}
- bdb_cache_entryinfo_unlock( ei );
if ( free ) {
e->e_private = NULL;
bdb_entry_return( e );