plug leaks

This commit is contained in:
Pierangelo Masarati 2005-07-25 20:47:39 +00:00
parent 5ecdfd13b4
commit a91ebfac79
5 changed files with 25 additions and 8 deletions

View file

@ -401,7 +401,8 @@ struct ldapconn *
ldap_back_getconn( Operation *op, SlapReply *rs, ldap_back_send_t sendok )
{
struct ldapinfo *li = (struct ldapinfo *)op->o_bd->be_private;
struct ldapconn *lc, lc_curr = { 0 };
struct ldapconn *lc,
lc_curr = { 0 };
int refcnt = 1;
/* Searches for a ldapconn in the avl tree */

View file

@ -106,7 +106,7 @@ static ConfigTable ldapcfg[] = {
ARG_BERVAL|ARG_MAGIC|LDAP_BACK_CFG_ACL_PASSWD,
ldap_back_cf_gen, NULL, NULL, NULL },
{ "acl-bind", "args", 2, 0, 0,
ARG_STRING|ARG_MAGIC|LDAP_BACK_CFG_ACL_BIND,
ARG_MAGIC|LDAP_BACK_CFG_ACL_BIND,
ldap_back_cf_gen, "( OLcfgDbAt:3.4 "
"NAME 'olcDbACLBind' "
"DESC 'Remote ACL administrative identity auth bind configuration' "
@ -144,7 +144,7 @@ static ConfigTable ldapcfg[] = {
ARG_BERVAL|ARG_MAGIC|LDAP_BACK_CFG_IDASSERT_PASSWD,
ldap_back_cf_gen, NULL, NULL, NULL },
{ "idassert-bind", "args", 2, 0, 0,
ARG_STRING|ARG_MAGIC|LDAP_BACK_CFG_IDASSERT_BIND,
ARG_MAGIC|LDAP_BACK_CFG_IDASSERT_BIND,
ldap_back_cf_gen, "( OLcfgDbAt:3.7 "
"NAME 'olcDbIDAssertBind' "
"DESC 'Remote Identity Assertion administrative identity auth bind configuration' "
@ -719,7 +719,7 @@ ldap_back_cf_gen( ConfigArgs *c )
li->url = ldap_charray2str( urllist, " " );
ldap_charray_free( urllist );
#else
li->url = ch_strdup( c->value_string );
li->url = c->value_string;
#endif
break;
}

View file

@ -40,7 +40,7 @@ typedef struct monitor_callback_t {
/* modify callback
for user-defined entries */
int (*mc_free)( Entry *e, void *priv );
/* update callback
/* delete callback
for user-defined entries */
void *mc_private; /* opaque pointer to
private data */

View file

@ -280,7 +280,11 @@ monitor_entry_destroy( void *v_mc )
mp = ( monitor_entry_t * )mc->mc_e->e_private;
if ( mp->mp_cb ) {
/* TODO */
if ( mp->mp_cb->mc_free ) {
mp->mp_cb->mc_free( mc->mc_e,
mp->mp_cb->mc_private );
}
ch_free( mp->mp_cb );
}
ldap_pvt_thread_mutex_destroy( &mp->mp_mutex );

View file

@ -104,7 +104,6 @@ static ConfigDriver config_sizelimit;
static ConfigDriver config_timelimit;
static ConfigDriver config_overlay;
static ConfigDriver config_suffix;
static ConfigDriver config_deref_depth;
static ConfigDriver config_rootdn;
static ConfigDriver config_rootpw;
static ConfigDriver config_restrict;
@ -1681,7 +1680,9 @@ config_rootpw(ConfigArgs *c) {
if (c->op == SLAP_CONFIG_EMIT) {
if (!BER_BVISEMPTY(&c->be->be_rootpw)) {
ber_dupbv( &c->value_bv, &c->be->be_rootpw);
/* don't copy, because "rootpw" is marked
* as CFG_BERVAL */
c->value_bv = c->be->be_rootpw;
return 0;
}
return 1;
@ -1882,6 +1883,15 @@ loglevel_init( void )
return slap_verbmasks_init( &loglevel_ops, lo );
}
static void
loglevel_destroy( void )
{
if ( loglevel_ops ) {
(void)slap_verbmasks_destroy( loglevel_ops );
}
loglevel_ops = NULL;
}
static slap_mask_t loglevel_ignore[] = { -1, 0 };
int
@ -4114,6 +4124,8 @@ config_back_db_destroy( BackendDB *be )
free( be->be_private );
loglevel_destroy();
return 0;
}