ITS#7906 more cleanup

db_open/close were not symmetric with init/destroy
This commit is contained in:
Howard Chu 2014-08-11 13:48:29 -07:00
parent 6e430cca90
commit d8e280e87c

View file

@ -2305,6 +2305,8 @@ ppolicy_db_init(
pwcons++;
}
ov_count++;
return 0;
}
@ -2314,7 +2316,6 @@ ppolicy_db_open(
ConfigReply *cr
)
{
ov_count++;
return overlay_register_control( be, LDAP_CONTROL_PASSWORDPOLICYREQUEST );
}
@ -2324,16 +2325,10 @@ ppolicy_db_close(
ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *) be->bd_info;
pp_info *pi = on->on_bi.bi_private;
#ifdef SLAP_CONFIG_DELETE
overlay_unregister_control( be, LDAP_CONTROL_PASSWORDPOLICYREQUEST );
#endif /* SLAP_CONFIG_DELETE */
free( pi->def_policy.bv_val );
free( pi );
return 0;
}
@ -2343,6 +2338,13 @@ ppolicy_db_destroy(
ConfigReply *cr
)
{
slap_overinst *on = (slap_overinst *) be->bd_info;
pp_info *pi = on->on_bi.bi_private;
on->on_bi.bi_private = NULL;
free( pi->def_policy.bv_val );
free( pi );
ov_count--;
if ( ov_count <=0 && pwcons ) {
pw_conn *pwc = pwcons;