Skip to content

Commit d865892

Browse files
committed
Fix leaks
1 parent 531c502 commit d865892

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ext/mbstring/mbstring.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,6 +1401,7 @@ PHP_FUNCTION(mb_language)
14011401
zend_string *ini_name = zend_string_init("mbstring.language", sizeof("mbstring.language") - 1, 0);
14021402
if (FAILURE == zend_alter_ini_entry(ini_name, name, PHP_INI_USER, PHP_INI_STAGE_RUNTIME)) {
14031403
zend_value_error("Unknown language \"%s\"", ZSTR_VAL(name));
1404+
zend_string_release_ex(ini_name, 0);
14041405
return;
14051406
} else {
14061407
RETVAL_TRUE;
@@ -4894,15 +4895,17 @@ MBSTRING_API size_t php_mb_stripos(int mode, const char *old_haystack, size_t ol
48944895
if ((offset > 0 && (size_t)offset > haystack_char_len) ||
48954896
(offset < 0 && (size_t)(-offset) > haystack_char_len)) {
48964897
zend_value_error("Offset is greater than the length of haystack string");
4897-
return -1;
4898+
n = -1;
4899+
break;
48984900
}
48994901
} else {
49004902
if (offset < 0) {
49014903
offset += (zend_long)haystack_char_len;
49024904
}
49034905
if (offset < 0 || (size_t)offset > haystack_char_len) {
49044906
zend_value_error("Offset not contained in string");
4905-
return -1;
4907+
n = -1;
4908+
break;
49064909
}
49074910
}
49084911
}

0 commit comments

Comments
 (0)