Skip to content

Commit

Permalink
fix-client-memory-dealloc fix review
Browse files Browse the repository at this point in the history
  • Loading branch information
snarky-snarksson committed Feb 7, 2024
1 parent e681db6 commit 052d209
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -683,10 +683,16 @@ minio::s3::PutObjectResponse minio::s3::Client::PutObject(PutObjectArgs args) {
"SSE operation must be performed over a secure connection");
}

std::vector<char> buf(args.part_size + 1);
char* buf = NULL;
if (args.part_count > 0) {
buf = new char[args.part_size];
} else {
buf = new char[args.part_size + 1];
}

std::string upload_id;
PutObjectResponse resp = PutObject(args, upload_id, (char*)&buf[0]);
PutObjectResponse resp = PutObject(args, upload_id, buf);
delete[] buf;

if (!resp && !upload_id.empty()) {
AbortMultipartUploadArgs amu_args;
Expand Down

0 comments on commit 052d209

Please sign in to comment.