From 7cbcf652c51d283ac55b898c60ea39e45a48e5dd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 2 May 2010 15:53:14 +0200 Subject: s4-ldb: use a parent context in the ldb utils This avoids a talloc free with references error on exit --- source4/lib/ldb/tools/ldbedit.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/lib/ldb/tools/ldbedit.c') diff --git a/source4/lib/ldb/tools/ldbedit.c b/source4/lib/ldb/tools/ldbedit.c index 4c5683cd83..1866cc373e 100644 --- a/source4/lib/ldb/tools/ldbedit.c +++ b/source4/lib/ldb/tools/ldbedit.c @@ -284,8 +284,9 @@ int main(int argc, const char **argv) int ret; const char *expression = "(|(objectClass=*)(distinguishedName=*))"; const char * const * attrs = NULL; + TALLOC_CTX *mem_ctx = talloc_new(NULL); - ldb = ldb_init(NULL, NULL); + ldb = ldb_init(mem_ctx, NULL); options = ldb_cmdline_process(ldb, argc, argv, usage); @@ -330,6 +331,7 @@ int main(int argc, const char **argv) } } - talloc_free(ldb); + talloc_free(mem_ctx); + return 0; } -- cgit