summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2021-01-28 14:32:53 -0800
committerKarolin Seeger <kseeger@samba.org>2021-02-03 21:23:55 +0000
commit7125792f0e15852c09482c6035b176f92cec6741 (patch)
treea3b7c86f58c7665f289114fdf371fce1b1d56a9a
parent42f41c5ca5e7138ef4eb9ad428e05e7c2760d528 (diff)
downloadsamba-7125792f0e15852c09482c6035b176f92cec6741.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> (cherry picked from commit faba89ad59eaa189f325be17377645862080a965)
-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;
}