From: Anatol Belski Date: Tue, 20 Jan 2015 19:46:45 +0000 (+0100) Subject: fix leaking of locale_string in TS build X-Git-Tag: PRE_PHP7_REMOVALS~25^2~67 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44cbba100a51f3a117e8a1d18898c520d88a3909;p=php fix leaking of locale_string in TS build actually more like an attempt as i see the leaks on travis, but don't repro on my boxes --- diff --git a/ext/standard/string.c b/ext/standard/string.c index fc25456c55..dc69a8a3ac 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -4550,11 +4550,12 @@ PHP_FUNCTION(setlocale) } if (len == loc->len && !memcmp(loc->val, retval, len)) { BG(locale_string) = zend_string_copy(loc); + RETURN_STR(BG(locale_string)); } else { BG(locale_string) = zend_string_init(retval, len, 0); zend_string_release(loc); + RETURN_STR(zend_string_copy(BG(locale_string))); } - RETURN_STR(zend_string_copy(BG(locale_string))); } else if (len == loc->len && !memcmp(loc->val, retval, len)) { RETURN_STR(loc); }