summaryrefslogtreecommitdiff
path: root/source4/torture/smb2
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture/smb2')
-rw-r--r--source4/torture/smb2/session.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/source4/torture/smb2/session.c b/source4/torture/smb2/session.c
index 3a0ef080aa..f565975834 100644
--- a/source4/torture/smb2/session.c
+++ b/source4/torture/smb2/session.c
@@ -96,6 +96,15 @@ bool test_session_reconnect(struct torture_context *tctx, struct smb2_tree *tree
goto done;
}
+ /* try to access the file via the old handle */
+
+ ZERO_STRUCT(qfinfo);
+ qfinfo.generic.level = RAW_FILEINFO_POSITION_INFORMATION;
+ qfinfo.generic.in.file.handle = _h1;
+ status = smb2_getinfo_file(tree, mem_ctx, &qfinfo);
+ CHECK_STATUS(status, NT_STATUS_USER_SESSION_DELETED);
+ h1 = NULL;
+
smb2_oplock_create_share(&io2, fname,
smb2_util_share_access(""),
smb2_util_oplock_level("b"));
@@ -107,15 +116,10 @@ bool test_session_reconnect(struct torture_context *tctx, struct smb2_tree *tree
_h2 = io2.out.file.handle;
h2 = &_h2;
- /* try to access the file via the old handle */
-
- ZERO_STRUCT(qfinfo);
- qfinfo.generic.level = RAW_FILEINFO_POSITION_INFORMATION;
- qfinfo.generic.in.file.handle = _h1;
- status = smb2_getinfo_file(tree, mem_ctx, &qfinfo);
- CHECK_STATUS(status, NT_STATUS_USER_SESSION_DELETED);
-
done:
+ if (h1 != NULL) {
+ smb2_util_close(tree, *h1);
+ }
if (h2 != NULL) {
smb2_util_close(tree2, *h2);
}