mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
ldb: use ldb_msg_new(), not talloc/talloc_zero
ldb_msg_new() is currently the same as talloc_zero(), but it might not always be. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
18966b6eee
commit
8f081b7f78
@ -772,7 +772,7 @@ struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb,
|
||||
ldif = talloc(ldb, struct ldb_ldif);
|
||||
if (!ldif) return NULL;
|
||||
|
||||
ldif->msg = talloc(ldif, struct ldb_message);
|
||||
ldif->msg = ldb_msg_new(ldif);
|
||||
if (ldif->msg == NULL) {
|
||||
talloc_free(ldif);
|
||||
return NULL;
|
||||
@ -781,10 +781,6 @@ struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb,
|
||||
ldif->changetype = LDB_CHANGETYPE_NONE;
|
||||
msg = ldif->msg;
|
||||
|
||||
msg->dn = NULL;
|
||||
msg->elements = NULL;
|
||||
msg->num_elements = 0;
|
||||
|
||||
chunk = next_chunk(ldb, ldif, fgetc_fn, private_data);
|
||||
if (!chunk) {
|
||||
goto failed;
|
||||
|
@ -40,7 +40,7 @@ static int traverse_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA _dbuf, void *sta
|
||||
{
|
||||
int ret, i, j;
|
||||
struct ldb_dn *dn = state;
|
||||
struct ldb_message *msg = talloc_zero(NULL, struct ldb_message);
|
||||
struct ldb_message *msg = ldb_msg_new(NULL);
|
||||
struct ldb_val dbuf = {
|
||||
.data = _dbuf.dptr,
|
||||
.length = _dbuf.dsize,
|
||||
|
Loading…
Reference in New Issue
Block a user