summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb/ldb_cache.c
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-20 13:53:14 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-20 12:31:05 +0000
commit06053a09cbf42cde12d69d0a296fb25f425aae67 (patch)
tree10d383ec861921c16e507384476817f2088651d5 /source4/lib/ldb/ldb_tdb/ldb_cache.c
parent1427895531c259f4bb6c561972b79051807c2a4d (diff)
downloadsamba-06053a09cbf42cde12d69d0a296fb25f425aae67.tar.gz
samba-06053a09cbf42cde12d69d0a296fb25f425aae67.tar.bz2
samba-06053a09cbf42cde12d69d0a296fb25f425aae67.zip
ldb:ldb_tdb submodule - use "ldb_msg_new" where appropriate
It is saver than a manual "talloc".
Diffstat (limited to 'source4/lib/ldb/ldb_tdb/ldb_cache.c')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_cache.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_cache.c b/source4/lib/ldb/ldb_tdb/ldb_cache.c
index 2f0ba22268..114eadaff5 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_cache.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_cache.c
@@ -203,7 +203,7 @@ static int ltdb_baseinfo_init(struct ldb_module *module)
ltdb->sequence_number = atof(initial_sequence_number);
- msg = talloc(ltdb, struct ldb_message);
+ msg = ldb_msg_new(ltdb);
if (msg == NULL) {
goto failed;
}
@@ -287,15 +287,15 @@ int ltdb_cache_load(struct ldb_module *module)
if (ltdb->cache == NULL) {
ltdb->cache = talloc_zero(ltdb, struct ltdb_cache);
if (ltdb->cache == NULL) goto failed;
- ltdb->cache->indexlist = talloc_zero(ltdb->cache, struct ldb_message);
- ltdb->cache->attributes = talloc_zero(ltdb->cache, struct ldb_message);
+ ltdb->cache->indexlist = ldb_msg_new(ltdb->cache);
+ ltdb->cache->attributes = ldb_msg_new(ltdb->cache);
if (ltdb->cache->indexlist == NULL ||
ltdb->cache->attributes == NULL) {
goto failed;
}
}
- baseinfo = talloc(ltdb->cache, struct ldb_message);
+ baseinfo = ldb_msg_new(ltdb->cache);
if (baseinfo == NULL) goto failed;
baseinfo_dn = ldb_dn_new(module, ldb, LTDB_BASEINFO);
@@ -327,7 +327,7 @@ int ltdb_cache_load(struct ldb_module *module)
ltdb->sequence_number = seq;
/* Read an interpret database options */
- options = talloc(ltdb->cache, struct ldb_message);
+ options = ldb_msg_new(ltdb->cache);
if (options == NULL) goto failed;
options_dn = ldb_dn_new(options, ldb, LTDB_OPTIONS);
@@ -352,8 +352,8 @@ int ltdb_cache_load(struct ldb_module *module)
talloc_free(ltdb->cache->indexlist);
- ltdb->cache->indexlist = talloc_zero(ltdb->cache, struct ldb_message);
- ltdb->cache->attributes = talloc_zero(ltdb->cache, struct ldb_message);
+ ltdb->cache->indexlist = ldb_msg_new(ltdb->cache);
+ ltdb->cache->attributes = ldb_msg_new(ltdb->cache);
if (ltdb->cache->indexlist == NULL ||
ltdb->cache->attributes == NULL) {
goto failed;
@@ -414,7 +414,7 @@ int ltdb_increase_sequence_number(struct ldb_module *module)
ldb = ldb_module_get_ctx(module);
- msg = talloc(ltdb, struct ldb_message);
+ msg = ldb_msg_new(ltdb);
if (msg == NULL) {
errno = ENOMEM;
return LDB_ERR_OPERATIONS_ERROR;