Skip to content

Commit 3503ec6

Browse files
committed
don't forget to destroy transient wraprecs!!!
1 parent 6be44b9 commit 3503ec6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

agent/php_user_instrument.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,15 @@ void nr_php_reset_user_instrumentation(void) {
579579
* Remove any transient wraprecs. This must only be called on request shutdown!
580580
*/
581581
void nr_php_remove_transient_user_instrumentation(void) {
582+
#if ZEND_MODULE_API_NO > ZEND_7_4_X_API_NO
583+
nruserfn_t* p = nr_transient_wraprecs;
584+
while (p) {
585+
nruserfn_t* wraprec = p;
586+
p = wraprec->next;
587+
nr_php_user_wraprec_destroy(&wraprec);
588+
}
589+
nr_transient_wraprecs = NULL;
590+
#endif
582591
#if ZEND_MODULE_API_NO < ZEND_7_4_X_API_NO
583592
nruserfn_t* p = nr_wrapped_user_functions;
584593
nruserfn_t* prev = NULL;

0 commit comments

Comments
 (0)