Skip to content

Commit

Permalink
encode_opentelemetry: fixed memory leaks
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Alminana <[email protected]>
  • Loading branch information
leonardo-albertovich authored and edsiper committed Sep 16, 2024
1 parent 02d9cc2 commit 9d0c2e3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ctr_encode_opentelemetry.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,12 @@ static Opentelemetry__Proto__Trace__V1__ScopeSpans **set_scope_spans(struct ctra

otel_scope_span = initialize_scope_span();
if (!otel_scope_span) {
if (scope_span_index > 0) {
destroy_scope_spans(scope_spans, scope_span_index - 1);
}

free(scope_spans);

return NULL;
}

Expand Down

0 comments on commit 9d0c2e3

Please sign in to comment.