summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-06-18 07:44:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:24 -0500
commit74037cbe92fccb7a7a4a3497e3942e08b0945ea9 (patch)
tree48b920f1ab3182d0fa9c8cb692ecb8cc4519d58f /source4/lib
parentf52b42c75fda1069664fdbedf392e4fca87d7fc0 (diff)
downloadsamba-74037cbe92fccb7a7a4a3497e3942e08b0945ea9.tar.gz
samba-74037cbe92fccb7a7a4a3497e3942e08b0945ea9.tar.bz2
samba-74037cbe92fccb7a7a4a3497e3942e08b0945ea9.zip
r7711: update callers of ldb_connect() for new syntax
(This used to be commit f852661463624714ad8e7adc0547b2f07b8f9f6d)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/db_wrap.c15
1 files changed, 11 insertions, 4 deletions
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) {