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
This commit is contained in:
Anatol Belski 2015-01-20 20:46:45 +01:00
parent 65aba8bd71
commit 44cbba100a

View File

@ -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);
}