r19362: - don't need to store the baseinfo message after cache load
authorAndrew Tridgell <tridge@samba.org>
Tue, 17 Oct 2006 01:21:02 +0000 (01:21 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:21:17 +0000 (14:21 -0500)
- set better names on talloc structures in ldb modules, making leaks
  easier to track down
(This used to be commit 3bf76db42dc6dde5d71083216dba819869b31c75)

source4/lib/ldb/common/ldb_modules.c
source4/lib/ldb/ldb_ildap/ldb_ildap.c
source4/lib/ldb/ldb_ldap/ldb_ldap.c
source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
source4/lib/ldb/ldb_tdb/ldb_tdb.c

index d627f3b9fa18315fe62fa7ed0294bb0167073d1f..325cab6dfda92e2be9723cb9272363b44380218e 100644 (file)
@@ -266,6 +266,7 @@ int ldb_load_modules_list(struct ldb_context *ldb, const char **module_list, str
                if (current == NULL) {
                        return LDB_ERR_OPERATIONS_ERROR;
                }
+               talloc_set_name(current, "ldb_module: %s", module_list[i]);
                
                current->ldb = ldb;
                current->ops = ops;
index 5b69ac06c9a16b24054cd4a1a7699b7094743999..3843d2b82508f7c13fe325de23e203b9af044817 100644 (file)
@@ -776,6 +776,7 @@ static int ildb_connect(struct ldb_context *ldb, const char *url,
                talloc_free(ildb);
                return -1;
        }
+       talloc_set_name_const(*module, "ldb_ildap backend");
        (*module)->ldb = ldb;
        (*module)->prev = (*module)->next = NULL;
        (*module)->private_data = ildb;
index a34e35c6db3012689cdcddd902b1e91e6d5df1be..410ad64b4adc20e2233aacf30edf04ed421fc2d0 100644 (file)
@@ -822,6 +822,7 @@ static int lldb_connect(struct ldb_context *ldb,
                talloc_free(lldb);
                return -1;
        }
+       talloc_set_name_const(*module, "ldb_ldap backend");
        (*module)->ldb = ldb;
        (*module)->prev = (*module)->next = NULL;
        (*module)->private_data = lldb;
index 91256222b1290d444dfa52e9ec7d117fb8c3a806..8dd25db1d6c628db4948e5d9578579dd447e7d13 100644 (file)
@@ -2101,6 +2101,7 @@ static int lsqlite3_connect(struct ldb_context *ldb,
                ldb_oom(ldb);
                goto failed;
        }
+       talloc_set_name_const(*module, "ldb_sqlite3 backend");
        (*module)->ldb = ldb;
        (*module)->prev = (*module)->next = NULL;
        (*module)->private_data = lsqlite3;
index b7a202442d101370ea14da0722458df1d6ba3260..fd1c8780ae65220554624b6313aae8801d9f989c 100644 (file)
@@ -1058,11 +1058,18 @@ static int ltdb_connect(struct ldb_context *ldb, const char *url,
                talloc_free(ltdb);
                return -1;
        }
+       talloc_set_name_const(*module, "ldb_tdb backend");
        (*module)->ldb = ldb;
        (*module)->prev = (*module)->next = NULL;
        (*module)->private_data = ltdb;
        (*module)->ops = &ltdb_ops;
 
+       if (ltdb_cache_load(*module) != 0) {
+               talloc_free(*module);
+               talloc_free(ltdb);
+               return -1;
+       }
+
        return 0;
 }