From 63f24e0137cbca08b671409a4f8b09fdffdfa52c Mon Sep 17 00:00:00 2001 From: ysaito1001 Date: Fri, 29 Nov 2024 13:18:12 -0600 Subject: [PATCH] Fix memory leak in test detected by `LeakSanitizer` --- aws-s3-transfer-manager/src/operation/upload_objects/worker.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws-s3-transfer-manager/src/operation/upload_objects/worker.rs b/aws-s3-transfer-manager/src/operation/upload_objects/worker.rs index d90d234..2c8d083 100644 --- a/aws-s3-transfer-manager/src/operation/upload_objects/worker.rs +++ b/aws-s3-transfer-manager/src/operation/upload_objects/worker.rs @@ -783,7 +783,7 @@ mod tests { let contents = vec![0; MIN_MULTIPART_PART_SIZE_BYTES as usize]; let ctx = UploadObjectsContext::new(handle, input); let job = UploadObjectJob { - object: InputStream::from(Bytes::from_static(Box::leak(contents.into_boxed_slice()))), + object: InputStream::from(Bytes::copy_from_slice(contents.as_slice())), key: key.to_owned(), };