File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1032,6 +1032,9 @@ PHP_FUNCTION(grapheme_levenshtein)
1032
1032
intl_error_set_code (NULL , ustatus1 );
1033
1033
1034
1034
intl_error_set_custom_msg (NULL , "Error on ubrk_setText on ustring1" , 0 );
1035
+ if (ustring2 ) {
1036
+ efree (ustring2 );
1037
+ }
1035
1038
if (ustring1 ) {
1036
1039
efree (ustring1 );
1037
1040
}
@@ -1046,6 +1049,9 @@ PHP_FUNCTION(grapheme_levenshtein)
1046
1049
if (ustring2 ) {
1047
1050
efree (ustring2 );
1048
1051
}
1052
+ if (ustring1 ) {
1053
+ efree (ustring1 );
1054
+ }
1049
1055
RETURN_FALSE ;
1050
1056
}
1051
1057
@@ -1079,11 +1085,29 @@ PHP_FUNCTION(grapheme_levenshtein)
1079
1085
if (U_FAILURE (ustatus2 )) {
1080
1086
intl_error_set_code (NULL , ustatus2 );
1081
1087
intl_error_set_custom_msg (NULL , "Error usearch_open" , 0 );
1088
+ ubrk_close (bi1 );
1089
+ ubrk_close (bi2 );
1090
+
1091
+ efree (ustring1 );
1092
+ efree (ustring2 );
1093
+
1094
+ efree (p1 );
1095
+ efree (p2 );
1096
+ RETURN_FALSE ;
1082
1097
}
1083
1098
usrch_pos = usearch_first (srch , & ustatus2 );
1084
1099
if (U_FAILURE (ustatus2 )) {
1085
1100
intl_error_set_code (NULL , ustatus2 );
1086
1101
intl_error_set_custom_msg (NULL , "Error usearch_first" , 0 );
1102
+ ubrk_close (bi1 );
1103
+ ubrk_close (bi2 );
1104
+
1105
+ efree (ustring1 );
1106
+ efree (ustring2 );
1107
+
1108
+ efree (p1 );
1109
+ efree (p2 );
1110
+ RETURN_FALSE ;
1087
1111
}
1088
1112
usearch_close (srch );
1089
1113
You can’t perform that action at this time.
0 commit comments