Commit 88d57510 authored by Howard Chu's avatar Howard Chu
Browse files

ITS#5094 fix from HEAD

parent 1b1fa920
......@@ -61,6 +61,7 @@ typedef struct pw_conn {
static pw_conn *pwcons;
static int ppolicy_cid;
static int ov_count;
typedef struct pass_policy {
AttributeDescription *ad; /* attribute to which the policy applies */
......@@ -2118,6 +2119,7 @@ ppolicy_db_open(
BackendDB *be
)
{
ov_count++;
return overlay_register_control( be, LDAP_CONTROL_PASSWORDPOLICYREQUEST );
}
......@@ -2128,8 +2130,13 @@ ppolicy_close(
{
slap_overinst *on = (slap_overinst *) be->bd_info;
pp_info *pi = on->on_bi.bi_private;
free( pwcons );
/* Perhaps backover should provide bi_destroy hooks... */
ov_count--;
if ( ov_count <=0 && pwcons ) {
free( pwcons );
pwcons = NULL;
}
free( pi->def_policy.bv_val );
free( pi );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment