Skip to content

Commit

Permalink
Merge branch 'master' into leonardo-master-fluent-bit-issue-9267-fix
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper authored Aug 28, 2024
2 parents c468905 + 9711d3e commit 5d14c6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cmt_encode_opentelemetry.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,13 +711,13 @@ static inline Opentelemetry__Proto__Common__V1__AnyValue *cfl_variant_binary_to_
result->bytes_value.len = cfl_sds_len(value->data.as_bytes);
result->bytes_value.data = calloc(result->bytes_value.len, sizeof(char));

if (result->bytes_value.data == NULL) {
if (result->bytes_value.data) {
memcpy(result->bytes_value.data, value->data.as_bytes, result->bytes_value.len);
}
else {
otlp_any_value_destroy(result);

result = NULL;
}

memcpy(result->bytes_value.data, value->data.as_bytes, result->bytes_value.len);
}

return result;
Expand Down
2 changes: 2 additions & 0 deletions tests/prometheus_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1669,6 +1669,7 @@ void test_issue_fluent_bit_9267()
{
char errbuf[256];
int status;
cfl_sds_t result = NULL;
struct cmt *cmt;
struct cmt_decode_prometheus_parse_opts opts;
memset(&opts, 0, sizeof(opts));
Expand All @@ -1688,6 +1689,7 @@ void test_issue_fluent_bit_9267()
if (cmt != NULL) {
cmt_decode_prometheus_destroy(cmt);
}
cmt_decode_prometheus_destroy(cmt);
cfl_sds_destroy(in_buf);
}

Expand Down

0 comments on commit 5d14c6d

Please sign in to comment.