Skip to content

Commit b1feba4

Browse files
committed
couple fix
1 parent cbe0c9e commit b1feba4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

source/s3_checksum_context.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ static struct aws_s3_upload_request_checksum_context *s_s3_upload_request_checks
3333

3434
aws_ref_count_init(&context->ref_count, context, s_aws_s3_upload_request_checksum_context_destroy);
3535
context->allocator = allocator;
36+
if (aws_mutex_init(&context->synced_data.lock)) {
37+
aws_s3_upload_request_checksum_context_release(context);
38+
return NULL;
39+
}
3640
/* Handle case where no checksum config is provided */
3741
if (!checksum_config || checksum_config->checksum_algorithm == AWS_SCA_NONE) {
3842
context->algorithm = AWS_SCA_NONE;
@@ -53,10 +57,6 @@ static struct aws_s3_upload_request_checksum_context *s_s3_upload_request_checks
5357
return NULL;
5458
}
5559
context->encoded_checksum_size = encoded_size;
56-
if (!aws_mutex_init(&context->synced_data.lock)) {
57-
aws_s3_upload_request_checksum_context_release(context);
58-
return NULL;
59-
}
6060
return context;
6161
}
6262

source/s3_chunk_stream.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static int s_set_post_chunk_stream(struct aws_chunk_stream *parent_stream) {
7070
}
7171
}
7272
struct aws_byte_cursor checksum_result_cursor =
73-
aws_s3_upload_request_checksum_context_get_checksum_cursor(&parent_stream->checksum_context);
73+
aws_s3_upload_request_checksum_context_get_checksum_cursor(parent_stream->checksum_context);
7474
AWS_ASSERT(parent_stream->checksum_context->encoded_checksum_size == checksum_result_cursor.len);
7575

7676
if (aws_byte_buf_init(

0 commit comments

Comments
 (0)