com php-src: fix leaking of locale_string in TS build : ext/standard/string.c

From: Date: Tue, 20 Jan 2015 19:52:44 +0000
Subject: com php-src: fix leaking of locale_string in TS build : ext/standard/string.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-84223@lists.php.net to get a copy of this message
Commit: 44cbba100a51f3a117e8a1d18898c520d88a3909 Author: Anatol Belski <ab@php.net> Tue, 20 Jan 2015 20:46:45 +0100 Parents: 65aba8bd71428135a5a94062bc106c9929a4fc76 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=44cbba100a51f3a117e8a1d18898c520d88a3909 Log: 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 Changed paths: M ext/standard/string.c Diff: diff --git a/ext/standard/string.c b/ext/standard/string.c index fc25456..dc69a8a 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); }

« previous php.cvs (#84223) next »