From 6d94e4d95e153c9f692a0d044b00dfd8b45e3a7c Mon Sep 17 00:00:00 2001 From: Jennifer Sutton Date: Fri, 2 Aug 2024 14:42:10 +1200 Subject: [PATCH] =?utf8?q?s3:smbd:=20Don=E2=80=99t=20free=20the=20caller?= =?utf8?q?=E2=80=99s=20buffer=20(CID=201610056)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jennifer Sutton Reviewed-by: Douglas Bagnall --- source3/smbd/smb1_process.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source3/smbd/smb1_process.c b/source3/smbd/smb1_process.c index a1970b9e252..0dfefa147df 100644 --- a/source3/smbd/smb1_process.c +++ b/source3/smbd/smb1_process.c @@ -255,7 +255,9 @@ bool smb1_srv_send(struct smbXsrv_connection *xconn, len = smb_len_large(buf_out) + 4; ret = write_data(xconn->transport.sock, buf_out, len); - srv_free_enc_buffer(xconn, encrypted_buf); + if (encrypted_buf != buffer) { + srv_free_enc_buffer(xconn, encrypted_buf); + } if (ret <= 0) { int saved_errno = errno; /* -- 2.47.3