]> granicus.if.org Git - php/commitdiff
Free attribute validators on shutdown
authorNikita Popov <nikita.ppv@gmail.com>
Fri, 5 Jun 2020 08:36:35 +0000 (10:36 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 5 Jun 2020 08:36:35 +0000 (10:36 +0200)
Zend/zend.c
Zend/zend_attributes.c
Zend/zend_attributes.h

index 0303e99b60ba740a564be1b73d7e4f76c7b07965..8a2bbf35dd1bbcd5d6d9363fb0e33a1b473d1e7f 100644 (file)
@@ -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;
index 12a997e72f594fcce3d003af8a80247c9e816b82..b9bd467acf5461269bbe6cff2d2981f3e0d4061a 100644 (file)
@@ -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);
+}
index d7e54173cac6730d716ddda5d6f8cc782e99248f..0e0136ff6d03e6fdeab9c25f3ca20c7c7b32c56d 100644 (file)
@@ -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