diff options
author | Anatol Belski <ab@php.net> | 2018-09-08 21:38:05 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2018-09-08 21:38:05 +0200 |
commit | 3de0ba7cbfa2947a8ee2362e84c7ed876678e635 (patch) | |
tree | 0e01163900553d23ec1d3949ec1f70585b886979 | |
parent | a303089ffe9f4eaaacc97ccd6acac272a03d13bd (diff) | |
parent | c6ddd45650c295bdf800c600e89a15c0af9a1e09 (diff) | |
download | php-git-3de0ba7cbfa2947a8ee2362e84c7ed876678e635.tar.gz |
Merge branch 'PHP-7.3'
* PHP-7.3:
Fixed bug #76850 Exit code mangled by set locale/preg_match
-rw-r--r-- | ext/pcre/php_pcre.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index b9213d4909..3910b41fea 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -729,6 +729,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex) if (key != regex) { tables = (uint8_t *)zend_hash_find_ptr(&char_tables, BG(locale_string)); if (!tables) { + zend_string *_k; tables = pcre2_maketables(gctx); if (UNEXPECTED(!tables)) { 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) efree(pattern); return NULL; } - zend_hash_add_ptr(&char_tables, BG(locale_string), (void *)tables); + _k = zend_string_dup(BG(locale_string), 1); + zend_hash_add_ptr(&char_tables, _k, (void *)tables); + zend_string_release(_k); } pcre2_set_character_tables(cctx, tables); } |