It can still run after ppolicy_close has freed the connection table
static int
ppolicy_connection_destroy( BackendDB *bd, Connection *conn )
{
- if ( !BER_BVISEMPTY( &pwcons[conn->c_conn_idx].dn )) {
+ if ( pwcons && !BER_BVISEMPTY( &pwcons[conn->c_conn_idx].dn )) {
ch_free( pwcons[conn->c_conn_idx].dn.bv_val );
BER_BVZERO( &pwcons[conn->c_conn_idx].dn );
}
/* Perhaps backover should provide bi_destroy hooks... */
ov_count--;
if ( ov_count <=0 && pwcons ) {
- pwcons--;
- free( pwcons );
+ pw_conn *pwc = pwcons;
pwcons = NULL;
+ pwc--;
+ ch_free( pwc );
}
free( pi->def_policy.bv_val );
free( pi );