Skip to content

Commit 5b4c4bb

Browse files
committed
Free attribute validators on shutdown
1 parent d3eeeb6 commit 5b4c4bb

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

Zend/zend.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "zend_smart_str.h"
3333
#include "zend_smart_string.h"
3434
#include "zend_cpuinfo.h"
35+
#include "zend_attributes.h"
3536

3637
static size_t global_map_ptr_last = 0;
3738

@@ -1077,6 +1078,7 @@ void zend_shutdown(void) /* {{{ */
10771078
zend_hash_destroy(GLOBAL_CONSTANTS_TABLE);
10781079
free(GLOBAL_CONSTANTS_TABLE);
10791080
zend_shutdown_strtod();
1081+
zend_attributes_shutdown();
10801082

10811083
#ifdef ZTS
10821084
GLOBAL_FUNCTION_TABLE = NULL;

Zend/zend_attributes.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,8 @@ void zend_register_attribute_ce(void)
144144

145145
zend_compiler_attribute_register(zend_ce_php_attribute, zend_attribute_validate_phpattribute);
146146
}
147+
148+
void zend_attributes_shutdown(void)
149+
{
150+
zend_hash_destroy(&internal_validators);
151+
}

Zend/zend_attributes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,6 @@ static zend_always_inline zend_attribute *zend_add_class_constant_attribute(zend
6565
}
6666

6767
void zend_register_attribute_ce(void);
68+
void zend_attributes_shutdown(void);
6869

6970
#endif

0 commit comments

Comments
 (0)