summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Pauli <jpauli@php.net>2016-07-08 15:06:36 +0200
committerJulien Pauli <jpauli@php.net>2016-07-08 15:06:36 +0200
commit4b483cdc9a3fb28bbd16eec49aec9308b51be9fc (patch)
tree4ed69d2d74e96a0b2d2bc958f0fe16ec98f5d96b
parent720b085feb3e6ac0ff7acdea6f52be2c47a1a987 (diff)
parenta8df121e18807d90fea2c0c4cdd1e17eed0f445a (diff)
downloadphp-git-4b483cdc9a3fb28bbd16eec49aec9308b51be9fc.tar.gz
Merge branch 'PHP-7.0'
* PHP-7.0: Updated NEWS Updated NEWS Backported bug #71144 (Segmentation fault when using cURL with ZTS) fix bug #72024 (microtime() leaks memory)
-rw-r--r--ext/standard/string.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 1efb266c82..c3f5eebb1b 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -196,7 +196,6 @@ static zend_string *php_hex2bin(const unsigned char *old, const size_t oldlen)
* glibc's localeconv is not reentrant, so lets make it so ... sorta */
PHPAPI struct lconv *localeconv_r(struct lconv *out)
{
- struct lconv *res;
# ifdef ZTS
tsrm_mutex_lock( locale_mutex );
@@ -210,16 +209,14 @@ PHPAPI struct lconv *localeconv_r(struct lconv *out)
/* Even with the enabled per thread locale, localeconv
won't check any locale change in the master thread. */
_locale_t cur = _get_current_locale();
-
- res = cur->locinfo->lconv;
+ *out = *cur->locinfo->lconv;
+ _free_locale(cur);
}
#else
/* localeconv doesn't return an error condition */
- res = localeconv();
+ *out = *localeconv();
#endif
- *out = *res;
-
# ifdef ZTS
tsrm_mutex_unlock( locale_mutex );
# endif