diff --git a/lib/ctraces/CMakeLists.txt b/lib/ctraces/CMakeLists.txt index 425384fcce9..3cef9282fe2 100644 --- a/lib/ctraces/CMakeLists.txt +++ b/lib/ctraces/CMakeLists.txt @@ -27,7 +27,7 @@ endif() # CTraces Version set(CTR_VERSION_MAJOR 0) set(CTR_VERSION_MINOR 5) -set(CTR_VERSION_PATCH 3) +set(CTR_VERSION_PATCH 5) set(CTR_VERSION_STR "${CTR_VERSION_MAJOR}.${CTR_VERSION_MINOR}.${CTR_VERSION_PATCH}") # Define __FILENAME__ consistently across Operating Systems diff --git a/lib/ctraces/src/ctr_decode_opentelemetry.c b/lib/ctraces/src/ctr_decode_opentelemetry.c index 067e88d9be9..0e845e15f84 100644 --- a/lib/ctraces/src/ctr_decode_opentelemetry.c +++ b/lib/ctraces/src/ctr_decode_opentelemetry.c @@ -532,6 +532,7 @@ int ctr_decode_opentelemetry_create(struct ctrace **out_ctr, otel_resource_span = service_request->resource_spans[resource_span_index]; if (otel_resource_span == NULL) { opentelemetry__proto__collector__trace__v1__export_trace_service_request__free_unpacked(service_request, NULL); + ctr_destroy(ctr); return -1; } diff --git a/lib/ctraces/src/ctr_encode_opentelemetry.c b/lib/ctraces/src/ctr_encode_opentelemetry.c index e8a95f149aa..8f0c81ed0bb 100644 --- a/lib/ctraces/src/ctr_encode_opentelemetry.c +++ b/lib/ctraces/src/ctr_encode_opentelemetry.c @@ -1042,6 +1042,7 @@ static Opentelemetry__Proto__Trace__V1__ResourceSpans **set_resource_spans(struc otel_resource_span = initialize_resource_span(); if (!otel_resource_span) { + free(rs); return NULL; } otel_resource_span->resource = ctr_set_resource(resource_span->resource); @@ -1305,12 +1306,12 @@ cfl_sds_t ctr_encode_opentelemetry_create(struct ctrace *ctr) len = opentelemetry__proto__collector__trace__v1__export_trace_service_request__get_packed_size(req); buf = cfl_sds_create_size(len); if (!buf) { + destroy_export_service_request(req); return NULL; } cfl_sds_set_len(buf, len); opentelemetry__proto__collector__trace__v1__export_trace_service_request__pack(req, (uint8_t *)buf); - destroy_export_service_request(req); return buf;