]> granicus.if.org Git - php/commitdiff
Use a copy of locale instead of the original. Fixes bug #19482.
authorAndrei Zmievski <andrei@php.net>
Mon, 7 Oct 2002 17:16:23 +0000 (17:16 +0000)
committerAndrei Zmievski <andrei@php.net>
Mon, 7 Oct 2002 17:16:23 +0000 (17:16 +0000)
ext/pcre/php_pcre.c

index 44b0a7327eea20e10ddb9172a101cf343cfd6565..084dd4958fcb185fa857270e387f19267f036495 100644 (file)
@@ -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,