diff options
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r-- | ext/pcre/php_pcre.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 44b0a7327e..084dd4958f 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -66,6 +66,7 @@ static void php_free_pcre_cache(void *data) pefree(pce->re, 1); #if HAVE_SETLOCALE if ((void*)pce->tables) pefree((void*)pce->tables, 1); + pefree(pce->locale, 1); #endif } @@ -302,7 +303,7 @@ PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_ new_entry.extra = *extra; new_entry.preg_options = poptions; #if HAVE_SETLOCALE - new_entry.locale = locale; + new_entry.locale = pestrdup(locale, 1); new_entry.tables = tables; #endif zend_hash_update(&PCRE_G(pcre_cache), regex, regex_len+1, (void *)&new_entry, |