diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-06-15 00:27:51 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:18:12 -0500 |
commit | c0947b0d7f809f5139fbfcdbd618ed7b0a77d2be (patch) | |
tree | 7c0d7391b8f27d55e40b22f2c16315356e10a167 /source4/libcli/ldap/ldap_ldif.c | |
parent | 74a3621089d4d1e9ba4c1a02e44247d1cff29200 (diff) | |
download | samba-c0947b0d7f809f5139fbfcdbd618ed7b0a77d2be.tar.gz samba-c0947b0d7f809f5139fbfcdbd618ed7b0a77d2be.tar.bz2 samba-c0947b0d7f809f5139fbfcdbd618ed7b0a77d2be.zip |
r7593: simplified the memory management in the ldap code. Having a mem_ctx
element in a structure is not necessary any more.
(This used to be commit 912d0427f52eac811b27bf7e385b0642f7dc7f53)
Diffstat (limited to 'source4/libcli/ldap/ldap_ldif.c')
-rw-r--r-- | source4/libcli/ldap/ldap_ldif.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source4/libcli/ldap/ldap_ldif.c b/source4/libcli/ldap/ldap_ldif.c index 2489a97748..0e0885c1cc 100644 --- a/source4/libcli/ldap/ldap_ldif.c +++ b/source4/libcli/ldap/ldap_ldif.c @@ -212,7 +212,7 @@ static BOOL fill_add_attributes(struct ldap_message *msg, char **chunk) } if (attrib == NULL) { - r->attributes = talloc_realloc(msg->mem_ctx, + r->attributes = talloc_realloc(msg, r->attributes, struct ldap_attribute, r->num_attributes+1); @@ -222,11 +222,11 @@ static BOOL fill_add_attributes(struct ldap_message *msg, char **chunk) attrib = &(r->attributes[r->num_attributes]); r->num_attributes += 1; ZERO_STRUCTP(attrib); - attrib->name = talloc_strdup(msg->mem_ctx, + attrib->name = talloc_strdup(msg, attr_name); } - if (!add_value_to_attrib(msg->mem_ctx, &value, attrib)) + if (!add_value_to_attrib(msg, &value, attrib)) return False; } return True; @@ -261,7 +261,7 @@ static BOOL fill_mods(struct ldap_message *msg, char **chunk) struct ldap_mod mod; mod.type = LDAP_MODIFY_NONE; - mod.attrib.name = talloc_strdup(msg->mem_ctx, value.data); + mod.attrib.name = talloc_strdup(msg, value.data); if (strequal(attr_name, "add")) mod.type = LDAP_MODIFY_ADD; @@ -290,14 +290,14 @@ static BOOL fill_mods(struct ldap_message *msg, char **chunk) mod.attrib.name)); return False; } - if (!add_value_to_attrib(msg->mem_ctx, &value, + if (!add_value_to_attrib(msg, &value, &mod.attrib)) { DEBUG(3, ("Could not add value\n")); return False; } } - if (!add_mod_to_array_talloc(msg->mem_ctx, &mod, &r->mods, + if (!add_mod_to_array_talloc(msg, &mod, &r->mods, &r->num_mods)) return False; } @@ -370,7 +370,7 @@ static struct ldap_message *ldif_read(TALLOC_CTX *mem_ctx, int (*fgetc_fn)(void if (msg == NULL) return NULL; - chunk = next_chunk(msg->mem_ctx, fgetc_fn, private_data); + chunk = next_chunk(msg, fgetc_fn, private_data); if (!chunk) { goto failed; } @@ -388,7 +388,7 @@ static struct ldap_message *ldif_read(TALLOC_CTX *mem_ctx, int (*fgetc_fn)(void goto failed; } - dn = talloc_strdup(msg->mem_ctx, value.data); + dn = talloc_strdup(msg, value.data); if (next_attr(&s, &attr, &value) != 0) { goto failed; |