summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb/ldb_tdb.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-10-16 03:15:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:21:07 -0500
commit1b8e6fa6e9b45eb99ee34fa1a7628598d287c0f9 (patch)
tree48465bdad4b309db591a57488ba11994c9aa068e /source4/lib/ldb/ldb_tdb/ldb_tdb.c
parentb0fadb51b210d6400bc66bce8603b522e1aad347 (diff)
downloadsamba-1b8e6fa6e9b45eb99ee34fa1a7628598d287c0f9.tar.gz
samba-1b8e6fa6e9b45eb99ee34fa1a7628598d287c0f9.tar.bz2
samba-1b8e6fa6e9b45eb99ee34fa1a7628598d287c0f9.zip
r19314: Commit tridge's fixes for a big mem leak in ltdb I introduced
when the code has been changed to be async. With the other committed fixes now this works. (This used to be commit 49fc640b5c0398516ac3a9e3f7c55205cd60b1de)
Diffstat (limited to 'source4/lib/ldb/ldb_tdb/ldb_tdb.c')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_tdb.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
index 608120e3a7..bd3045d477 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -79,13 +79,12 @@ static int ltdb_err_map(enum TDB_ERROR tdb_code)
struct ldb_handle *init_ltdb_handle(struct ltdb_private *ltdb, struct ldb_module *module,
- void *context,
- int (*callback)(struct ldb_context *, void *, struct ldb_reply *))
+ struct ldb_request *req)
{
struct ltdb_context *ac;
struct ldb_handle *h;
- h = talloc_zero(ltdb, struct ldb_handle);
+ h = talloc_zero(req, struct ldb_handle);
if (h == NULL) {
ldb_set_errstring(module->ldb, "Out of Memory");
return NULL;
@@ -106,8 +105,8 @@ struct ldb_handle *init_ltdb_handle(struct ltdb_private *ltdb, struct ldb_module
h->status = LDB_SUCCESS;
ac->module = module;
- ac->context = context;
- ac->callback = callback;
+ ac->context = req->context;
+ ac->callback = req->callback;
return h;
}
@@ -307,7 +306,7 @@ static int ltdb_add(struct ldb_module *module, struct ldb_request *req)
}
}
- req->handle = init_ltdb_handle(ltdb, module, req->context, req->callback);
+ req->handle = init_ltdb_handle(ltdb, module, req);
if (req->handle == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -416,7 +415,7 @@ static int ltdb_delete(struct ldb_module *module, struct ldb_request *req)
return LDB_ERR_OPERATIONS_ERROR;
}
- req->handle = init_ltdb_handle(ltdb, module, req->context, req->callback);
+ req->handle = init_ltdb_handle(ltdb, module, req);
if (req->handle == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -772,7 +771,7 @@ static int ltdb_modify(struct ldb_module *module, struct ldb_request *req)
req->handle = NULL;
- req->handle = init_ltdb_handle(ltdb, module, req->context, req->callback);
+ req->handle = init_ltdb_handle(ltdb, module, req);
if (req->handle == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -826,7 +825,7 @@ static int ltdb_rename(struct ldb_module *module, struct ldb_request *req)
return LDB_ERR_OPERATIONS_ERROR;
}
- req->handle = init_ltdb_handle(ltdb, module, req->context, req->callback);
+ req->handle = init_ltdb_handle(ltdb, module, req);
if (req->handle == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}