summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2017-06-13 16:25:25 -0700
committerJeremy Allison <jra@samba.org>2017-06-17 06:39:20 +0200
commit5c0efc9a5ef8ddf96dc394110063bebd5f057415 (patch)
tree768c96c443a8e7958896841ba8431062b23abc92 /source3/torture
parent39026f1c5dbb83120b70b3d9131138a9c2344ba6 (diff)
downloadsamba-5c0efc9a5ef8ddf96dc394110063bebd5f057415.tar.gz
s3: smbtorture: Show correct use of cli_state_save_tcon() / cli_state_restore_tcon().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12831 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/test_smb2.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/torture/test_smb2.c b/source3/torture/test_smb2.c
index c0d11e61087..9368ab3264d 100644
--- a/source3/torture/test_smb2.c
+++ b/source3/torture/test_smb2.c
@@ -170,7 +170,10 @@ bool run_smb2_basic(int dummy)
}
saved_tid = smb2cli_tcon_current_id(cli->smb2.tcon);
- saved_tcon = cli->smb2.tcon;
+ saved_tcon = cli_state_save_tcon(cli);
+ if (saved_tcon == NULL) {
+ return false;
+ }
cli->smb2.tcon = smbXcli_tcon_create(cli);
smb2cli_tcon_set_values(cli->smb2.tcon,
NULL, /* session */
@@ -187,8 +190,7 @@ bool run_smb2_basic(int dummy)
printf("smb2cli_tdis returned %s\n", nt_errstr(status));
return false;
}
- talloc_free(cli->smb2.tcon);
- cli->smb2.tcon = saved_tcon;
+ cli_state_restore_tcon(cli, saved_tcon);
status = smb2cli_tdis(cli->conn,
cli->timeout,