summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/gentest.c2
-rw-r--r--source4/torture/locktest.c2
-rw-r--r--source4/torture/locktest2.c2
-rw-r--r--source4/torture/torture.c17
4 files changed, 13 insertions, 10 deletions
diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c
index a9d162b540..d6f5046820 100644
--- a/source4/torture/gentest.c
+++ b/source4/torture/gentest.c
@@ -164,7 +164,7 @@ static BOOL connect_servers(void)
for (j=0;j<NINSTANCES;j++) {
if (servers[i].cli[j]) {
smbcli_tdis(servers[i].cli[j]);
- smbcli_shutdown(servers[i].cli[j]);
+ talloc_free(servers[i].cli[j]);
servers[i].cli[j] = NULL;
}
}
diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c
index 4b4e9d3bd3..62eabeb688 100644
--- a/source4/torture/locktest.c
+++ b/source4/torture/locktest.c
@@ -150,7 +150,7 @@ static void reconnect(struct smbcli_state *cli[NSERVERS][NCONNECTIONS], int fnum
fnum[server][conn][f] = -1;
}
}
- smbcli_shutdown(cli[server][conn]);
+ talloc_free(cli[server][conn]);
}
cli[server][conn] = connect_one(share[server], server);
if (!cli[server][conn]) {
diff --git a/source4/torture/locktest2.c b/source4/torture/locktest2.c
index 4bd99cd5d0..e5cd8a60af 100644
--- a/source4/torture/locktest2.c
+++ b/source4/torture/locktest2.c
@@ -196,7 +196,7 @@ static void reconnect(struct smbcli_state *cli[NSERVERS][NCONNECTIONS],
smbcli_close(cli[server][conn], fnum[server][fstype][conn][f]);
}
smbcli_ulogoff(cli[server][conn]);
- smbcli_shutdown(cli[server][conn]);
+ talloc_free(cli[server][conn]);
}
cli[server][conn] = connect_one(share[server]);
if (!cli[server][conn]) {
diff --git a/source4/torture/torture.c b/source4/torture/torture.c
index 5036822aa4..1ca4046a49 100644
--- a/source4/torture/torture.c
+++ b/source4/torture/torture.c
@@ -56,21 +56,24 @@ static struct smbcli_state *open_nbt_connection(void)
cli = smbcli_state_init(NULL);
if (!cli) {
printf("Failed initialize smbcli_struct to connect with %s\n", host);
- return NULL;
+ goto failed;
}
if (!smbcli_socket_connect(cli, host)) {
printf("Failed to connect with %s\n", host);
- return cli;
+ goto failed;
}
if (!smbcli_transport_establish(cli, &calling, &called)) {
printf("%s rejected the session\n",host);
- smbcli_shutdown(cli);
- return NULL;
+ goto failed;
}
return cli;
+
+failed:
+ talloc_free(cli);
+ return NULL;
}
BOOL torture_open_connection_share(struct smbcli_state **c,
@@ -112,7 +115,7 @@ BOOL torture_close_connection(struct smbcli_state *c)
printf("tdis failed (%s)\n", smbcli_errstr(c->tree));
ret = False;
}
- smbcli_shutdown(c);
+ talloc_free(c);
return ret;
}
@@ -489,7 +492,7 @@ static BOOL run_tcon_test(void)
if (NT_STATUS_IS_ERR(smbcli_tconX(cli, share, "?????", password))) {
printf("%s refused 2nd tree connect (%s)\n", host,
smbcli_errstr(cli->tree));
- smbcli_shutdown(cli);
+ talloc_free(cli);
return False;
}
@@ -649,7 +652,7 @@ static BOOL run_tcon_devtype_test(void)
if (!tcon_devtest(cli1, share, "FOOBA", NT_STATUS_BAD_DEVICE_TYPE))
ret = False;
- smbcli_shutdown(cli1);
+ talloc_free(cli1);
if (ret)
printf("Passed tcondevtest\n");