summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/subtree_rename.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-03-29 13:32:15 +1100
committerAndrew Bartlett <abartlet@samba.org>2008-03-29 13:32:15 +1100
commit1c1c6fca660c304630672e87c20819daf8e008fc (patch)
tree5c8e323ce94d7dbba93570c344f97716ab5e788a /source4/dsdb/samdb/ldb_modules/subtree_rename.c
parente0c90d613121432700ea44011fda51e623de996c (diff)
downloadsamba-1c1c6fca660c304630672e87c20819daf8e008fc.tar.gz
samba-1c1c6fca660c304630672e87c20819daf8e008fc.tar.bz2
samba-1c1c6fca660c304630672e87c20819daf8e008fc.zip
Fix more valgrind issues.
This passes down the timeout more consistantly, and ensures that no matter how the modules screw up, we don't free() the memory we are going to write into the ASN1 packet until we actually write it out. Andrew Bartlett (This used to be commit eefd46289b90967ce6b4cd385fb1f7e1d6f9b343)
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/subtree_rename.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/subtree_rename.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/subtree_rename.c b/source4/dsdb/samdb/ldb_modules/subtree_rename.c
index bf8124e253..fd1388d416 100644
--- a/source4/dsdb/samdb/ldb_modules/subtree_rename.c
+++ b/source4/dsdb/samdb/ldb_modules/subtree_rename.c
@@ -117,7 +117,15 @@ static int subtree_rename_search_callback(struct ldb_context *ldb, void *context
NULL,
NULL);
- if (ret != LDB_SUCCESS) return ret;
+ if (ret != LDB_SUCCESS) {
+ return ret;
+ }
+
+ ret = ldb_set_timeout_from_prev_req(ldb, ac->orig_req, req);
+
+ if (ret != LDB_SUCCESS) {
+ return ret;
+ }
talloc_steal(req, newdn);
@@ -186,6 +194,12 @@ static int subtree_rename(struct ldb_module *module, struct ldb_request *req)
return ret;
}
+ ret = ldb_set_timeout_from_prev_req(module->ldb, req, new_req);
+
+ if (ret != LDB_SUCCESS) {
+ return ret;
+ }
+
ac->down_req = talloc_realloc(ac, ac->down_req,
struct ldb_request *, ac->num_requests + 1);
if (!ac->down_req) {