From: Jennifer Sutton Date: Fri, 2 Aug 2024 02:42:10 +0000 (+1200) Subject: s3:smbd: Don’t free the caller’s buffer (CID 1610056) X-Git-Tag: tevent-0.17.0~114 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6d94e4d95e153c9f692a0d044b00dfd8b45e3a7c;p=thirdparty%2Fsamba.git s3:smbd: Don’t free the caller’s buffer (CID 1610056) Signed-off-by: Jennifer Sutton Reviewed-by: Douglas Bagnall --- 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; /*