diff options
author | Stefan Metzmacher <metze@samba.org> | 2004-11-06 20:15:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:35 -0500 |
commit | 8408b3428d8c263f8453a0da8ef71e7fc1e4ec81 (patch) | |
tree | 4c8b4a7686f730333fdf137c28166c7c561414b0 /source4/libcli/ldap/ldap_ldif.c | |
parent | eee5cc3b9a6fe7cdc1fa81fac8ce524391bee519 (diff) | |
download | samba-8408b3428d8c263f8453a0da8ef71e7fc1e4ec81.tar.gz samba-8408b3428d8c263f8453a0da8ef71e7fc1e4ec81.tar.bz2 samba-8408b3428d8c263f8453a0da8ef71e7fc1e4ec81.zip |
r3583: - seperate the ldap client code and the ldap parsing code
(vl: we should only sync the parsing code with trunk)
- use hierachical talloc in the ldap client code
metze
(This used to be commit 1e9c0b68ca9ddb28877d45fc1b47653b13a7446d)
Diffstat (limited to 'source4/libcli/ldap/ldap_ldif.c')
-rw-r--r-- | source4/libcli/ldap/ldap_ldif.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source4/libcli/ldap/ldap_ldif.c b/source4/libcli/ldap/ldap_ldif.c index 19f4e56e73..c276b7e917 100644 --- a/source4/libcli/ldap/ldap_ldif.c +++ b/source4/libcli/ldap/ldap_ldif.c @@ -307,7 +307,7 @@ static BOOL fill_mods(struct ldap_message *msg, char **chunk) /* read from a LDIF source, creating a ldap_message */ -static struct ldap_message *ldif_read(int (*fgetc_fn)(void *), +static struct ldap_message *ldif_read(TALLOC_CTX *mem_ctx, int (*fgetc_fn)(void *), void *private_data) { struct ldap_message *msg; @@ -318,7 +318,7 @@ static struct ldap_message *ldif_read(int (*fgetc_fn)(void *), value.data = NULL; - msg = new_ldap_message(); + msg = new_ldap_message(mem_ctx); if (msg == NULL) return NULL; @@ -383,7 +383,7 @@ static struct ldap_message *ldif_read(int (*fgetc_fn)(void *), DEBUG(3, ("changetype %s not supported\n", (char *)value.data)); failed: - destroy_ldap_message(msg); + talloc_free(msg); return NULL; } @@ -403,10 +403,10 @@ static int fgetc_string(void *private_data) return EOF; } -struct ldap_message *ldap_ldif2msg(const char *s) +struct ldap_message *ldap_ldif2msg(TALLOC_CTX *mem_ctx, const char *s) { struct ldif_read_string_state state; state.s = s; - return ldif_read(fgetc_string, &state); + return ldif_read(mem_ctx, fgetc_string, &state); } |