From: Howard Chu Date: Mon, 11 Aug 2014 20:48:29 +0000 (-0700) Subject: ITS#7906 more cleanup X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d8e280e87c60aebb676c3a12141bfe937231089f;p=openldap ITS#7906 more cleanup db_open/close were not symmetric with init/destroy --- diff --git a/servers/slapd/overlays/ppolicy.c b/servers/slapd/overlays/ppolicy.c index 820905e9b1..3fdcda9f1a 100644 --- a/servers/slapd/overlays/ppolicy.c +++ b/servers/slapd/overlays/ppolicy.c @@ -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;