File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -729,6 +729,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
729729 if (key != regex ) {
730730 tables = (uint8_t * )zend_hash_find_ptr (& char_tables , BG (locale_string ));
731731 if (!tables ) {
732+ zend_string * _k ;
732733 tables = pcre2_maketables (gctx );
733734 if (UNEXPECTED (!tables )) {
734735 php_error_docref (NULL ,E_WARNING , "Failed to generate locale character tables" );
@@ -737,7 +738,9 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
737738 efree (pattern );
738739 return NULL ;
739740 }
740- zend_hash_add_ptr (& char_tables , BG (locale_string ), (void * )tables );
741+ _k = zend_string_dup (BG (locale_string ), 1 );
742+ zend_hash_add_ptr (& char_tables , _k , (void * )tables );
743+ zend_string_release (_k );
741744 }
742745 pcre2_set_character_tables (cctx , tables );
743746 }
You can’t perform that action at this time.
0 commit comments