summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/objectclass.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-10-30 23:35:04 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:43:46 +0100
commit2de30ecd942e05e5416a9f14c91d58324a0bc6eb (patch)
treee02a80b3bad2fdf98898ef46d97717f55b492d42 /source4/dsdb/samdb/ldb_modules/objectclass.c
parent46210e11f14373a213ec6fa32a20e9e183d641bf (diff)
downloadsamba-2de30ecd942e05e5416a9f14c91d58324a0bc6eb.tar.gz
samba-2de30ecd942e05e5416a9f14c91d58324a0bc6eb.tar.bz2
samba-2de30ecd942e05e5416a9f14c91d58324a0bc6eb.zip
r25755: Fix a couple of memory leaks, in particular a new leak onto the NULL
context caused by my objectclass module work. Andrew Bartlett (This used to be commit 2a835d900fee71e4461d5d18e39b4358fa6fdfba)
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/objectclass.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/objectclass.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c
index 6d40759e7b..12a6359037 100644
--- a/source4/dsdb/samdb/ldb_modules/objectclass.c
+++ b/source4/dsdb/samdb/ldb_modules/objectclass.c
@@ -389,7 +389,7 @@ static int objectclass_add(struct ldb_module *module, struct ldb_request *req)
/* return or own handle to deal with this call */
req->handle = h;
- parent_dn = ldb_dn_get_parent(ac->search_req, ac->orig_req->op.mod.message->dn);
+ parent_dn = ldb_dn_get_parent(ac, ac->orig_req->op.mod.message->dn);
if (parent_dn == NULL) {
ldb_oom(module->ldb);
return LDB_ERR_OPERATIONS_ERROR;
@@ -403,6 +403,8 @@ static int objectclass_add(struct ldb_module *module, struct ldb_request *req)
return ret;
}
+ talloc_steal(ac->search_req, parent_dn);
+
ldb_set_timeout_from_prev_req(ac->module->ldb, ac->orig_req, ac->search_req);
ac->step = OC_SEARCH_ADD_PARENT;
@@ -873,7 +875,7 @@ static int objectclass_rename(struct ldb_module *module, struct ldb_request *req
/* return or own handle to deal with this call */
req->handle = h;
- parent_dn = ldb_dn_get_parent(ac->search_req, ac->orig_req->op.rename.newdn);
+ parent_dn = ldb_dn_get_parent(ac, ac->orig_req->op.rename.newdn);
if (parent_dn == NULL) {
ldb_oom(module->ldb);
return LDB_ERR_OPERATIONS_ERROR;
@@ -886,7 +888,7 @@ static int objectclass_rename(struct ldb_module *module, struct ldb_request *req
if (ret != LDB_SUCCESS) {
return ret;
}
-
+ talloc_steal(ac->search_req, parent_dn);
ldb_set_timeout_from_prev_req(ac->module->ldb, ac->orig_req, ac->search_req);
ac->step = OC_SEARCH_RENAME_PARENT;