Skip to content

Commit

Permalink
Fix SpanLink::fromHeaders() crash with no or invalid propagated tags
Browse files Browse the repository at this point in the history
Signed-off-by: Bob Weinand <[email protected]>
  • Loading branch information
bwoebi committed Jan 9, 2025
1 parent 53d0aa2 commit a4b7337
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ext/ddtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,9 @@ ZEND_METHOD(DDTrace_SpanLink, fromHeaders) {

zend_string *propagated_tags = ddtrace_format_propagated_tags(&result.propagated_tags, &result.meta_tags);
zend_string *full_tracestate = ddtrace_format_tracestate(result.tracestate, 0, result.origin, result.priority_sampling, propagated_tags, &result.tracestate_unknown_dd_keys);
zend_string_release(propagated_tags);
if (propagated_tags) {
zend_string_release(propagated_tags);
}
if (full_tracestate) {
ZVAL_STR(&link->property_trace_state, full_tracestate);
}
Expand Down

0 comments on commit a4b7337

Please sign in to comment.