com php-src: Fixed valgrind reported issue with setlocale: ext/standard/string.c
| From: | Xinchen Hui | Date: | Wed, 21 Jan 2015 04:03:19 +0000 |
| Subject: | com php-src: Fixed valgrind reported issue with setlocale: ext/standard/string.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84249@lists.php.net to get a copy of this message | ||
Commit: fa06343d7e0e04f4a660218f6dbb7ce18c3f090b
Author: Xinchen Hui <laruence@php.net> Wed, 21 Jan 2015 12:03:19 +0800
Parents: 88e88426dfd75c12d209927c8d0db22c762af3a8
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fa06343d7e0e04f4a660218f6dbb7ce18c3f090b
Log:
Fixed valgrind reported issue with setlocale
Changed paths:
M ext/standard/string.c
Diff:
diff --git a/ext/standard/string.c b/ext/standard/string.c
index dc69a8a..6d5b1f2 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -4550,7 +4550,7 @@ PHP_FUNCTION(setlocale)
}
if (len == loc->len && !memcmp(loc->val, retval, len)) {
BG(locale_string) = zend_string_copy(loc);
- RETURN_STR(BG(locale_string));
+ RETURN_STR(zend_string_copy(BG(locale_string)));
} else {
BG(locale_string) = zend_string_init(retval, len, 0);
zend_string_release(loc);