diff options
author | Michael Maroszek <maroszek@gmx.net> | 2016-07-07 14:24:05 +0200 |
---|---|---|
committer | Julien Pauli <jpauli@php.net> | 2016-07-08 14:36:44 +0200 |
commit | 0be13d2dc24f2802a231f92912ba5d089dad6676 (patch) | |
tree | 14c0ef1428311dfa68a9d458a781e1ccdfe30827 | |
parent | bfc42211d3cc5aa6cd2bdb10ef5004ce22099acb (diff) | |
download | php-git-0be13d2dc24f2802a231f92912ba5d089dad6676.tar.gz |
fix bug #72024 (microtime() leaks memory)
-rw-r--r-- | ext/standard/string.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c index 39413c8211..1ecbdb97ce 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -195,7 +195,6 @@ static char *php_hex2bin(const unsigned char *old, const size_t oldlen, size_t * * 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 ); @@ -206,16 +205,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 |