From: Jeremy Allison Date: Thu, 28 Jan 2021 22:32:53 +0000 (-0800) Subject: s3: libsmb: Ensure we disconnect the temporary SMB1 tcon pointer on failure to set... X-Git-Tag: tevent-0.11.0~1844 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=faba89ad59eaa189f325be17377645862080a965;p=thirdparty%2Fsamba.git 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 Reviewed-by: Andreas Schneider --- 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; }