Skip to content

Commit

Permalink
[ext] Properly handle removal of function callback in dd_untrace
Browse files Browse the repository at this point in the history
  • Loading branch information
labbati committed Jan 21, 2019
1 parent 233fa3c commit 1d67604
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ext/ddtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ static PHP_FUNCTION(dd_untrace) {
RETURN_BOOL(0);
}
DD_PRINTF("Untracing function: %s", Z_STRVAL_P(function));

// Remove the traced function from the global lookup
zend_hash_del(&DDTRACE_G(function_lookup), function, &Z_STRLEN_P(function));
#else
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "S", &function) != SUCCESS) {
if (!DDTRACE_G(ignore_missing_overridables)) {
Expand All @@ -234,10 +237,10 @@ static PHP_FUNCTION(dd_untrace) {
}
RETURN_BOOL(0);
}
#endif

// Remove the traced function from the global lookup
zend_hash_del(&DDTRACE_G(function_lookup), function, &Z_STRLEN_P(function));
zend_hash_del(&DDTRACE_G(function_lookup), function);
#endif

#if PHP_VERSION_ID < 70000
FREE_ZVAL(function);
Expand Down

0 comments on commit 1d67604

Please sign in to comment.