summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/string.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 2c60e207fb..fc25456c55 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -4550,12 +4550,11 @@ 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(BG(locale_string));
}
+ RETURN_STR(zend_string_copy(BG(locale_string)));
} else if (len == loc->len && !memcmp(loc->val, retval, len)) {
RETURN_STR(loc);
}