ltdb->sequence_number = atof(initial_sequence_number);
- msg = talloc(ltdb, struct ldb_message);
+ msg = ldb_msg_new(ltdb);
if (msg == NULL) {
goto failed;
}
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);
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);
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;
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;
struct ldb_message *msg;
int ret = LDB_SUCCESS;
- msg = talloc(module, struct ldb_message);
+ msg = ldb_msg_new(module);
if (msg == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
return ltdb_err_map(tdb_error(ltdb->tdb));
}
- msg2 = talloc(tdb_key.dptr, struct ldb_message);
+ msg2 = ldb_msg_new(tdb_key.dptr);
if (msg2 == NULL) {
free(tdb_data.dptr);
ret = LDB_ERR_OTHER;
return LDB_ERR_OPERATIONS_ERROR;
}
- msg = talloc(ctx, struct ldb_message);
+ msg = ldb_msg_new(ctx);
if (msg == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
dn = ldb_dn_new(tmp_ctx, ldb, LTDB_BASEINFO);
- msg = talloc(tmp_ctx, struct ldb_message);
+ msg = ldb_msg_new(tmp_ctx);
if (msg == NULL) {
ret = LDB_ERR_OPERATIONS_ERROR;
goto done;