Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions ext/intl/grapheme/grapheme_string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,15 @@ U_CFUNC PHP_FUNCTION(grapheme_stripos)

found = php_memnstr(haystack_dup + noffset, needle_dup, needle_len, haystack_dup + haystack_len);

efree(haystack_dup);
efree(needle_dup);

if (found) {
RETURN_LONG(found - haystack_dup);
ret_pos = found - haystack_dup;
efree(haystack_dup);
RETURN_LONG(ret_pos);
}


efree(haystack_dup);
/* if needle was ascii too, we are all done, otherwise we need to try using Unicode to see what we get */
if ( grapheme_ascii_check((unsigned char *)needle, needle_len) >= 0 ) {
RETURN_FALSE;
Expand Down
Loading