Skip to content

Commit

Permalink
Fix a use-after-free
Browse files Browse the repository at this point in the history
  • Loading branch information
iamluc authored and bwoebi committed Mar 28, 2024
1 parent 55d2c44 commit b3de131
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ext/span.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,13 +554,13 @@ void ddtrace_close_span(ddtrace_span_data *span) {
ddtrace_switch_span_stack(span->stack);
}

ddtrace_close_stack_userland_spans_until(span);

ddtrace_close_top_span_without_stack_swap(span);

// Telemetry: increment the spans_created counter
// Must be done at closing because we need to read the "component" span's meta which is not available at creation
ddtrace_telemetry_inc_spans_created(span);

ddtrace_close_stack_userland_spans_until(span);

ddtrace_close_top_span_without_stack_swap(span);
}

void ddtrace_close_span_restore_stack(ddtrace_span_data *span) {
Expand Down

0 comments on commit b3de131

Please sign in to comment.