svn commit: samba r19314 - in branches/SAMBA_4_0/source/lib/ldb/ldb_tdb: .

idra at samba.org idra at samba.org
Mon Oct 16 03:15:42 GMT 2006


Author: idra
Date: 2006-10-16 03:15:41 +0000 (Mon, 16 Oct 2006)
New Revision: 19314

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19314

Log:

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.



Modified:
   branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_search.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.h


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_search.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_search.c	2006-10-16 03:12:48 UTC (rev 19313)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_search.c	2006-10-16 03:15:41 UTC (rev 19314)
@@ -499,12 +499,11 @@
 		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) {
 		ltdb_unlock_read(module);
 		return LDB_ERR_OPERATIONS_ERROR;
 	}
-
 	ltdb_ac = talloc_get_type(req->handle->private_data, struct ltdb_context);
 
 	ltdb_ac->tree = req->op.search.tree;

Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c	2006-10-16 03:12:48 UTC (rev 19313)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c	2006-10-16 03:15:41 UTC (rev 19314)
@@ -79,13 +79,12 @@
 
 
 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 @@
 	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 @@
 		}
 	}
 	
-	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 @@
 		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 @@
 	
 	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 @@
 		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;
 	}

Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.h
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.h	2006-10-16 03:12:48 UTC (rev 19313)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.h	2006-10-16 03:15:41 UTC (rev 19314)
@@ -110,8 +110,7 @@
 
 /* The following definitions come from lib/ldb/ldb_tdb/ldb_tdb.c  */
 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 TDB_DATA ltdb_key(struct ldb_module *module, const struct ldb_dn *dn);
 int ltdb_store(struct ldb_module *module, const struct ldb_message *msg, int flgs);
 int ltdb_delete_noindex(struct ldb_module *module, const struct ldb_dn *dn);



More information about the samba-cvs mailing list