summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-08-31 09:26:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:57 -0500
commit722d20f4ddef98ba8f305ea858c54e5df54ca27c (patch)
tree444f5a6845909d995e5744dfef22c52ddf421234
parentcca9dbb66f605edc950dc048eb51cc39d14a01d3 (diff)
downloadsamba-722d20f4ddef98ba8f305ea858c54e5df54ca27c.tar.gz
samba-722d20f4ddef98ba8f305ea858c54e5df54ca27c.tar.bz2
samba-722d20f4ddef98ba8f305ea858c54e5df54ca27c.zip
r17958: as talloc_init() enabled null tracking, we should avoid to use it
in smbtorture, and in the LOCAL-TALLOC we should reset the null tracking also make bin/smbtorture //url/foo LOCAL-TALLOC LOCAL-TALLOC possible metze (This used to be commit d1dd3df5e4fd21f5cbd00e472438fe3eadb266e5)
-rw-r--r--source4/lib/talloc/testsuite.c2
-rw-r--r--source4/torture/gentest.c2
-rw-r--r--source4/torture/misc.c4
-rw-r--r--source4/torture/smbtorture.c2
-rw-r--r--source4/torture/util_smb.c6
5 files changed, 9 insertions, 7 deletions
diff --git a/source4/lib/talloc/testsuite.c b/source4/lib/talloc/testsuite.c
index 013f01cc2c..ca5e9042d3 100644
--- a/source4/lib/talloc/testsuite.c
+++ b/source4/lib/talloc/testsuite.c
@@ -910,6 +910,7 @@ static BOOL test_loop(void)
printf("FAILED TO FIRE LOOP DESTRUCTOR\n");
return False;
}
+ loop_destructor_count = 0;
return True;
}
@@ -1021,6 +1022,7 @@ BOOL torture_local_talloc(struct torture_context *torture)
{
BOOL ret = True;
+ talloc_disable_null_tracking();
talloc_enable_null_tracking();
ret &= test_ref1();
diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c
index 0ee60f8a18..b8dc2362ea 100644
--- a/source4/torture/gentest.c
+++ b/source4/torture/gentest.c
@@ -1970,7 +1970,7 @@ static int run_test(void)
current_op.opnum = op;
current_op.name = gen_ops[which_op].name;
current_op.status = NT_STATUS_OK;
- current_op.mem_ctx = talloc_init("%s", current_op.name);
+ current_op.mem_ctx = talloc_named(NULL, 0, "%s", current_op.name);
ret = gen_ops[which_op].handler(instance);
diff --git a/source4/torture/misc.c b/source4/torture/misc.c
index f04b7782eb..62b956337c 100644
--- a/source4/torture/misc.c
+++ b/source4/torture/misc.c
@@ -395,7 +395,7 @@ static BOOL torture_ioctl_test(struct torture_context *torture)
return False;
}
- mem_ctx = talloc_init("ioctl_test");
+ mem_ctx = talloc_named_const(torture, 0, "ioctl_test");
printf("starting ioctl test\n");
@@ -786,7 +786,7 @@ static BOOL run_benchrw(struct torture_context *torture)
torture_numops,torture_nprocs);
/*init talloc context*/
- mem_ctx = talloc_init("bench-readwrite");
+ mem_ctx = talloc_named_const(torture, 0, "bench-readwrite");
ev = event_context_init(mem_ctx);
state = talloc_array(mem_ctx, struct benchrw_state *, torture_nprocs);
diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c
index 8d7552e075..d66e11b01b 100644
--- a/source4/torture/smbtorture.c
+++ b/source4/torture/smbtorture.c
@@ -195,7 +195,7 @@ static void usage(poptContext pc)
static BOOL is_binding_string(const char *binding_string)
{
- TALLOC_CTX *mem_ctx = talloc_init("is_binding_string");
+ TALLOC_CTX *mem_ctx = talloc_named_const(NULL, 0, "is_binding_string");
struct dcerpc_binding *binding_struct;
NTSTATUS status;
diff --git a/source4/torture/util_smb.c b/source4/torture/util_smb.c
index c1e4edc5e6..b823e69b75 100644
--- a/source4/torture/util_smb.c
+++ b/source4/torture/util_smb.c
@@ -53,7 +53,7 @@ NTSTATUS create_directory_handle(struct smbcli_tree *tree, const char *dname, in
union smb_open io;
TALLOC_CTX *mem_ctx;
- mem_ctx = talloc_init("create_directory_handle");
+ mem_ctx = talloc_named_const(tree, 0, "create_directory_handle");
io.generic.level = RAW_OPEN_NTCREATEX;
io.ntcreatex.in.root_fid = 0;
@@ -329,7 +329,7 @@ void dump_all_info(TALLOC_CTX *mem_ctx, union smb_fileinfo *finfo)
*/
void torture_all_info(struct smbcli_tree *tree, const char *fname)
{
- TALLOC_CTX *mem_ctx = talloc_init("%s", fname);
+ TALLOC_CTX *mem_ctx = talloc_named(tree, 0, "%s", fname);
union smb_fileinfo finfo;
NTSTATUS status;
@@ -373,7 +373,7 @@ NTSTATUS torture_set_sparse(struct smbcli_tree *tree, int fnum)
NTSTATUS status;
TALLOC_CTX *mem_ctx;
- mem_ctx = talloc_init("torture_set_sparse");
+ mem_ctx = talloc_named_const(tree, 0, "torture_set_sparse");
if (!mem_ctx) {
return NT_STATUS_NO_MEMORY;
}