summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-06-05 10:36:35 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-06-05 10:36:35 +0200
commit5b4c4bbe3ba5961c8cc96504c01eadecd6fa6853 (patch)
treee8763131e985733386510951e86d531cbdc25de1 /Zend
parentd3eeeb688204320c9825924bc300901470cdb87b (diff)
downloadphp-git-5b4c4bbe3ba5961c8cc96504c01eadecd6fa6853.tar.gz
Free attribute validators on shutdown
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend.c2
-rw-r--r--Zend/zend_attributes.c5
-rw-r--r--Zend/zend_attributes.h1
3 files changed, 8 insertions, 0 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index 0303e99b60..8a2bbf35dd 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -32,6 +32,7 @@
#include "zend_smart_str.h"
#include "zend_smart_string.h"
#include "zend_cpuinfo.h"
+#include "zend_attributes.h"
static size_t global_map_ptr_last = 0;
@@ -1077,6 +1078,7 @@ void zend_shutdown(void) /* {{{ */
zend_hash_destroy(GLOBAL_CONSTANTS_TABLE);
free(GLOBAL_CONSTANTS_TABLE);
zend_shutdown_strtod();
+ zend_attributes_shutdown();
#ifdef ZTS
GLOBAL_FUNCTION_TABLE = NULL;
diff --git a/Zend/zend_attributes.c b/Zend/zend_attributes.c
index 12a997e72f..b9bd467acf 100644
--- a/Zend/zend_attributes.c
+++ b/Zend/zend_attributes.c
@@ -144,3 +144,8 @@ void zend_register_attribute_ce(void)
zend_compiler_attribute_register(zend_ce_php_attribute, zend_attribute_validate_phpattribute);
}
+
+void zend_attributes_shutdown(void)
+{
+ zend_hash_destroy(&internal_validators);
+}
diff --git a/Zend/zend_attributes.h b/Zend/zend_attributes.h
index d7e54173ca..0e0136ff6d 100644
--- a/Zend/zend_attributes.h
+++ b/Zend/zend_attributes.h
@@ -65,5 +65,6 @@ static zend_always_inline zend_attribute *zend_add_class_constant_attribute(zend
}
void zend_register_attribute_ce(void);
+void zend_attributes_shutdown(void);
#endif