]> granicus.if.org Git - php/commitdiff
Make a copy unconditionally
authorAnatol Belski <ab@php.net>
Sun, 9 Sep 2018 08:42:53 +0000 (10:42 +0200)
committerAnatol Belski <ab@php.net>
Sun, 9 Sep 2018 08:42:53 +0000 (10:42 +0200)
ext/pcre/php_pcre.c

index 7aa879d26db1ca643a7553dd87ded8db6940a127..5165209b85d7adc00436ded22d242877c81761a0 100644 (file)
@@ -739,7 +739,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
                                efree(pattern);
                                return NULL;
                        }
-                       _k = zend_string_dup(BG(locale_string), 1);
+                       _k = zend_string_init(ZSTR_VAL(BG(locale_string)), ZSTR_LEN(BG(locale_string)), 1);
                        zend_hash_add_ptr(&char_tables, _k, (void *)tables);
                        zend_string_release(_k);
                }