From 87acba39f9e45eb6849cfd945ce6255bac5564c9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 13 Jun 2005 05:18:17 +0000 Subject: r7514: make the ldb_parse code not depend on a ldb_context, so we can now potentially use it in our ldap client code, instead of replicating all the code (This used to be commit 5b3575d9303d54a771e080a670dcd2f444b10c20) --- source4/lib/ldb/common/ldb_parse.c | 16 +++------------- source4/lib/ldb/include/ldb_parse.h | 3 +-- source4/lib/ldb/ldb_tdb/ldb_search.c | 2 +- 3 files changed, 5 insertions(+), 16 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/ldb/common/ldb_parse.c b/source4/lib/ldb/common/ldb_parse.c index 5221ef4556..e64e6d82d3 100644 --- a/source4/lib/ldb/common/ldb_parse.c +++ b/source4/lib/ldb/common/ldb_parse.c @@ -43,7 +43,6 @@ #include "includes.h" #include "ldb/include/ldb.h" -#include "ldb/include/ldb_private.h" #include "ldb/include/ldb_parse.h" #include @@ -327,22 +326,13 @@ static struct ldb_parse_tree *ldb_parse_filter(TALLOC_CTX *ctx, const char **s) expression ::= | */ -struct ldb_parse_tree *ldb_parse_tree(struct ldb_context *ldb, const char *s) +struct ldb_parse_tree *ldb_parse_tree(TALLOC_CTX *mem_ctx, const char *s) { while (isspace(*s)) s++; if (*s == '(') { - return ldb_parse_filter(ldb, &s); + return ldb_parse_filter(mem_ctx, &s); } - return ldb_parse_simple(ldb, s); + return ldb_parse_simple(mem_ctx, s); } - -/* - free a parse tree returned from ldb_parse_tree() -*/ -void ldb_parse_tree_free(struct ldb_context *ldb, struct ldb_parse_tree *tree) -{ - talloc_free(tree); -} - diff --git a/source4/lib/ldb/include/ldb_parse.h b/source4/lib/ldb/include/ldb_parse.h index d9125d05ed..50a9382534 100644 --- a/source4/lib/ldb/include/ldb_parse.h +++ b/source4/lib/ldb/include/ldb_parse.h @@ -54,7 +54,6 @@ struct ldb_parse_tree { } u; }; -struct ldb_parse_tree *ldb_parse_tree(struct ldb_context *ldb, const char *s); -void ldb_parse_tree_free(struct ldb_context *ldb, struct ldb_parse_tree *tree); +struct ldb_parse_tree *ldb_parse_tree(TALLOC_CTX *mem_ctx, const char *s); #endif diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c index 7883ee6e7b..e036ae0966 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_search.c +++ b/source4/lib/ldb/ldb_tdb/ldb_search.c @@ -506,7 +506,7 @@ int ltdb_search(struct ldb_module *module, const char *base, } } - ldb_parse_tree_free(ldb, tree); + talloc_free(tree); ltdb_unlock_read(module); return ret; -- cgit