summaryrefslogtreecommitdiff
path: root/source3/libsmb/clidfs.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2021-01-28 14:32:53 -0800
committerJeremy Allison <jra@samba.org>2021-02-02 19:54:34 +0000
commitfaba89ad59eaa189f325be17377645862080a965 (patch)
tree9358f34a66a0fb2db8c609b77a43fdfcaf3e8bb0 /source3/libsmb/clidfs.c
parent068f4a977f0539f790809d580bf22d2362032e3d (diff)
downloadsamba-faba89ad59eaa189f325be17377645862080a965.tar.gz
s3: libsmb: Ensure we disconnect the temporary SMB1 tcon pointer on failure to set up encryption.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13992 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/libsmb/clidfs.c')
-rw-r--r--source3/libsmb/clidfs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 26b5499cf73..040b957e6f8 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -1203,6 +1203,13 @@ bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
break;
case SMB_ENCRYPTION_REQUIRED:
default:
+ /*
+ * Failed to set up encryption.
+ * Disconnect the temporary IPC$
+ * tcon before restoring the original
+ * tcon so we don't leak it.
+ */
+ cli_tdis(cli);
cli_state_restore_tcon(cli, orig_tcon);
return false;
}