File tree 1 file changed +2
-13
lines changed
1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -1048,16 +1048,10 @@ PHP_FUNCTION(grapheme_levenshtein)
1048
1048
goto out_collator ;
1049
1049
}
1050
1050
1051
- zend_long * p1 , * p2 , * tmp ;
1052
- #if SIZEOF_SIZE_T == 8
1053
- /* strlen_2 is an int32_t, so it will not overflow. */
1054
- zend_long * pbuf = safe_emalloc (((size_t ) strlen_2 + 1 ) * 2 , sizeof (zend_long ), 0 );
1051
+ zend_long * pbuf , * p1 , * p2 , * tmp ;
1052
+ pbuf = safe_emalloc (strlen_2 + 1 , sizeof (zend_long ) * 2 , 0 );
1055
1053
p1 = pbuf ;
1056
1054
p2 = p1 + (strlen_2 + 1 );
1057
- #else
1058
- p1 = safe_emalloc (strlen_2 + 1 , sizeof (zend_long ), 0 );
1059
- p2 = safe_emalloc (strlen_2 + 1 , sizeof (zend_long ), 0 );
1060
- #endif
1061
1055
1062
1056
for (i2 = 0 ; i2 <= strlen_2 ; i2 ++ ) {
1063
1057
p1 [i2 ] = i2 * cost_ins ;
@@ -1105,12 +1099,7 @@ PHP_FUNCTION(grapheme_levenshtein)
1105
1099
retval = p1 [strlen_2 ];
1106
1100
RETVAL_LONG (retval );
1107
1101
1108
- #if SIZEOF_SIZE_T == 8
1109
1102
efree (pbuf );
1110
- #else
1111
- efree (p2 );
1112
- efree (p1 );
1113
- #endif
1114
1103
1115
1104
out_collator :
1116
1105
ucol_close (collator );
You can’t perform that action at this time.
0 commit comments