1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-23 09:57:40 +03:00

s4: torture: Remove talloc_autofree_context() from locktest.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
This commit is contained in:
Jeremy Allison 2017-04-24 16:18:16 -07:00
parent fa88c5da46
commit 45fbddda9c

View File

@ -580,18 +580,26 @@ int main(int argc, const char *argv[])
POPT_COMMON_VERSION
{ NULL }
};
TALLOC_CTX *mem_ctx = NULL;
int ret = -1;
setlinebuf(stdout);
seed = time(NULL);
mem_ctx = talloc_named_const(NULL, 0, "locktest_ctx");
if (mem_ctx == NULL) {
printf("Unable to allocate locktest_ctx\n");
exit(1);
}
pc = poptGetContext("locktest", argc, argv, long_options,
POPT_CONTEXT_KEEP_FIRST);
poptSetOtherOptionHelp(pc, "<unc1> <unc2>");
lp_ctx = cmdline_lp_ctx;
servers[0] = cli_credentials_init(talloc_autofree_context());
servers[1] = cli_credentials_init(talloc_autofree_context());
servers[0] = cli_credentials_init(mem_ctx);
servers[1] = cli_credentials_init(mem_ctx);
cli_credentials_guess(servers[0], lp_ctx);
cli_credentials_guess(servers[1], lp_ctx);
@ -603,6 +611,7 @@ int main(int argc, const char *argv[])
case 'U':
if (username_count == 2) {
usage(pc);
talloc_free(mem_ctx);
exit(1);
}
cli_credentials_parse_string(servers[username_count], poptGetOptArg(pc), CRED_SPECIFIED);
@ -642,7 +651,7 @@ int main(int argc, const char *argv[])
servers[1] = servers[0];
}
ev = s4_event_context_init(talloc_autofree_context());
ev = s4_event_context_init(mem_ctx);
gensec_init();
@ -650,6 +659,8 @@ int main(int argc, const char *argv[])
seed, lock_base, lock_range, min_length));
srandom(seed);
return test_locks(ev, lp_ctx, NULL, share);
ret = test_locks(ev, lp_ctx, NULL, share);
talloc_free(mem_ctx);
return ret;
}