summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/basic/secleak.c7
-rw-r--r--source4/torture/raw/context.c5
-rw-r--r--source4/torture/rpc/echo.c2
3 files changed, 3 insertions, 11 deletions
diff --git a/source4/torture/basic/secleak.c b/source4/torture/basic/secleak.c
index 54fa3ecee6..998faec54e 100644
--- a/source4/torture/basic/secleak.c
+++ b/source4/torture/basic/secleak.c
@@ -27,7 +27,6 @@ static BOOL try_failed_login(struct smbcli_state *cli)
NTSTATUS status;
union smb_sesssetup setup;
struct smbcli_session *session;
- TALLOC_CTX *mem_ctx = talloc_init("failed_login");
session = smbcli_session_init(cli->transport);
setup.generic.level = RAW_SESSSETUP_GENERIC;
@@ -37,15 +36,13 @@ static BOOL try_failed_login(struct smbcli_state *cli)
setup.generic.in.user = "INVALID-USERNAME";
setup.generic.in.domain = "INVALID-DOMAIN";
- status = smb_raw_session_setup(session, mem_ctx, &setup);
+ status = smb_raw_session_setup(session, session, &setup);
+ talloc_free(session);
if (NT_STATUS_IS_OK(status)) {
printf("Allowed session setup with invalid credentials?!\n");
return False;
}
- talloc_free(session);
- talloc_free(mem_ctx);
-
return True;
}
diff --git a/source4/torture/raw/context.c b/source4/torture/raw/context.c
index 194d2de93b..b5f439b5e9 100644
--- a/source4/torture/raw/context.c
+++ b/source4/torture/raw/context.c
@@ -81,7 +81,6 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("create a second security context on the same transport\n");
session = smbcli_session_init(cli->transport);
- talloc_increase_ref_count(cli->transport);
setup.generic.level = RAW_SESSSETUP_GENERIC;
setup.generic.in.sesskey = cli->transport->negotiate.sesskey;
@@ -97,7 +96,6 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("create a third security context on the same transport, with vuid set\n");
session2 = smbcli_session_init(cli->transport);
- talloc_increase_ref_count(cli->transport);
session2->vuid = session->vuid;
setup.generic.level = RAW_SESSSETUP_GENERIC;
@@ -119,7 +117,6 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
if (cli->transport->negotiate.capabilities & CAP_EXTENDED_SECURITY) {
printf("create a fourth security context on the same transport, without extended security\n");
session3 = smbcli_session_init(cli->transport);
- talloc_increase_ref_count(cli->transport);
session3->vuid = session->vuid;
setup.generic.level = RAW_SESSSETUP_GENERIC;
@@ -137,7 +134,6 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("use the same tree as the existing connection\n");
tree = smbcli_tree_init(session);
- talloc_increase_ref_count(session);
tree->tid = cli->tree->tid;
printf("create a file using the new vuid\n");
@@ -228,7 +224,6 @@ static BOOL test_tree(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("create a second tree context on the same session\n");
tree = smbcli_tree_init(cli->session);
- talloc_increase_ref_count(cli->session);
tcon.generic.level = RAW_TCON_TCONX;
tcon.tconx.in.flags = 0;
diff --git a/source4/torture/rpc/echo.c b/source4/torture/rpc/echo.c
index 707b0d0313..7d12c1b7f3 100644
--- a/source4/torture/rpc/echo.c
+++ b/source4/torture/rpc/echo.c
@@ -308,7 +308,7 @@ BOOL torture_rpc_echo(int dummy)
*/
printf("\n");
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
torture_rpc_close(p);
return ret;