Skip to content

Commit

Permalink
Prevent segfaults with ddtrace.disable=1 when appsec is active
Browse files Browse the repository at this point in the history
Signed-off-by: Bob Weinand <[email protected]>
  • Loading branch information
bwoebi committed Feb 19, 2025
1 parent d33f4c6 commit fbfbccd
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 @@ -1413,6 +1413,9 @@ static PHP_MINIT_FUNCTION(ddtrace) {
mod_ptr->handle = NULL;
/* }}} */

// Make sure it's available for appsec, i.e. before disabling
dd_ip_extraction_startup();

if (ddtrace_disable) {
return SUCCESS;
}
Expand Down Expand Up @@ -1452,7 +1455,6 @@ static PHP_MINIT_FUNCTION(ddtrace) {
ddtrace_engine_hooks_minit();

ddtrace_integrations_minit();
dd_ip_extraction_startup();
ddtrace_serializer_startup();

ddtrace_live_debugger_minit();
Expand Down

0 comments on commit fbfbccd

Please sign in to comment.