Skip to content

Commit 68c34ce

Browse files
committed
Make a copy unconditionally
1 parent 9278be1 commit 68c34ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/pcre/php_pcre.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
739739
efree(pattern);
740740
return NULL;
741741
}
742-
_k = zend_string_dup(BG(locale_string), 1);
742+
_k = zend_string_init(ZSTR_VAL(BG(locale_string)), ZSTR_LEN(BG(locale_string)), 1);
743743
zend_hash_add_ptr(&char_tables, _k, (void *)tables);
744744
zend_string_release(_k);
745745
}

0 commit comments

Comments
 (0)