From 74037cbe92fccb7a7a4a3497e3942e08b0945ea9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 18 Jun 2005 07:44:36 +0000 Subject: r7711: update callers of ldb_connect() for new syntax (This used to be commit f852661463624714ad8e7adc0547b2f07b8f9f6d) --- source4/lib/db_wrap.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/db_wrap.c b/source4/lib/db_wrap.c index a3a9ee9b86..33c2af2851 100644 --- a/source4/lib/db_wrap.c +++ b/source4/lib/db_wrap.c @@ -75,12 +75,13 @@ static int ldb_wrap_destructor(void *ctx) to close just talloc_free() the returned ldb_context */ struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx, - const char *url, - unsigned int flags, - const char *options[]) + const char *url, + unsigned int flags, + const char *options[]) { struct ldb_context *ldb; struct ldb_wrap *w; + int ret; for (w = ldb_list; w; w = w->next) { if (strcmp(url, w->url) == 0) { @@ -88,10 +89,16 @@ struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx, } } - ldb = ldb_connect(url, flags, options); + ldb = ldb_init(talloc_autofree_context()); if (ldb == NULL) { return NULL; } + + ret = ldb_connect(ldb, url, flags, options); + if (ret == -1) { + talloc_free(ldb); + return NULL; + } w = talloc(ldb, struct ldb_wrap); if (w == NULL) { -- cgit