summaryrefslogtreecommitdiff
path: root/ext/intl/formatter/formatter_parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/formatter/formatter_parse.c')
-rw-r--r--ext/intl/formatter/formatter_parse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/intl/formatter/formatter_parse.c b/ext/intl/formatter/formatter_parse.c
index 699feef18a..4aa6eabf6f 100644
--- a/ext/intl/formatter/formatter_parse.c
+++ b/ext/intl/formatter/formatter_parse.c
@@ -73,7 +73,9 @@ PHP_FUNCTION( numfmt_parse )
}
#if ICU_LOCALE_BUG && defined(LC_NUMERIC)
- oldlocale = setlocale(LC_NUMERIC, "C");
+ /* need to copy here since setlocale may change it later */
+ oldlocale = estrdup(setlocale(LC_NUMERIC, NULL));
+ setlocale(LC_NUMERIC, "C");
#endif
switch(type) {
@@ -100,6 +102,7 @@ PHP_FUNCTION( numfmt_parse )
}
#if ICU_LOCALE_BUG && defined(LC_NUMERIC)
setlocale(LC_NUMERIC, oldlocale);
+ efree(oldlocale);
#endif
if(zposition) {
zval_dtor(zposition);