ITS#9809: pcache, mdb: fix SEGV in monitor shutdown

This commit is contained in:
Howard Chu 2022-03-10 15:26:04 +00:00
parent a9d98407d2
commit e29ba72c56
2 changed files with 5 additions and 3 deletions

View file

@ -578,10 +578,11 @@ mdb_monitor_db_close( BackendDB *be )
monitor_extra_t *mbe;
if ( mi && mi->bi_extra ) {
struct berval dummy = BER_BVNULL;
mbe = mi->bi_extra;
mbe->unregister_entry_callback( &mdb->mi_monitor.mdm_ndn,
(monitor_callback_t *)mdb->mi_monitor.mdm_cb,
NULL, 0, NULL );
&dummy, 0, &dummy );
}
memset( &mdb->mi_monitor, 0, sizeof( mdb->mi_monitor ) );

View file

@ -5660,15 +5660,16 @@ pcache_monitor_db_close( BackendDB *be )
slap_overinst *on = (slap_overinst *)be->bd_info;
cache_manager *cm = on->on_bi.bi_private;
if ( cm->monitor_cb != NULL ) {
if ( !BER_BVISNULL( &cm->monitor_ndn )) {
BackendInfo *mi = backend_info( "monitor" );
monitor_extra_t *mbe;
if ( mi && mi->bi_extra ) {
struct berval dummy = BER_BVNULL;
mbe = mi->bi_extra;
mbe->unregister_entry_callback( &cm->monitor_ndn,
(monitor_callback_t *)cm->monitor_cb,
NULL, 0, NULL );
&dummy, 0, &dummy );
}
}