]> git.sur5r.net Git - openldap/commitdiff
plug leaks
authorPierangelo Masarati <ando@openldap.org>
Mon, 25 Jul 2005 20:47:39 +0000 (20:47 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 25 Jul 2005 20:47:39 +0000 (20:47 +0000)
servers/slapd/back-ldap/bind.c
servers/slapd/back-ldap/config.c
servers/slapd/back-monitor/back-monitor.h
servers/slapd/back-monitor/cache.c
servers/slapd/bconfig.c

index 251387218f34b66e3c6aec310cafda581c85ff3b..abd8912f7c341232b46ebc4a75c351c9d911c6a6 100644 (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 */
index c82239bad4aad82dbef8da816c6daca392c50420..9b25ed06c6ceeb9182632b304417255deb061600 100644 (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;
        }
index e85c76866d2711df13138de4879f1de3c9759976..15c853c86b6cf0e8a214bfffdaeb8726af3b09c2 100644 (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 */
index 4f5ca062a2318f35b39452dbcbaca4a2ed9fc176..d4c6292a6b0650c38203c71876e494f5f919456a 100644 (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 );
index 042d4b0d586f68adb943f4cf9eb16e1e9e876f4b..17ca8812de5351a4e40db88519e35df2bbca08dc 100644 (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;
 }