Skip to content

Commit 21c3a24

Browse files
committed
Move safe_emalloc back into zend_try, remove stray blank line
1 parent 5dd9815 commit 21c3a24

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

ext/iconv/iconv.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -959,8 +959,6 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
959959
goto out;
960960
}
961961

962-
buf = safe_emalloc(1, max_line_len, 5);
963-
964962
cd_pl = iconv_open(ICONV_ASCII_ENCODING, enc);
965963
if (cd_pl == (iconv_t)(-1)) {
966964
if (errno == EINVAL) {
@@ -984,6 +982,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
984982
char_cnt = max_line_len;
985983

986984
zend_try {
985+
buf = safe_emalloc(1, max_line_len, 5);
987986
_php_iconv_appendl(pretval, fname, fname_nbytes, cd_pl);
988987
char_cnt -= fname_nbytes;
989988
smart_str_appendl(pretval, ": ", sizeof(": ") - 1);
@@ -1189,7 +1188,6 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
11891188
} while (in_left > 0);
11901189

11911190
smart_str_0(pretval);
1192-
11931191
} zend_catch {
11941192
bailout = true;
11951193
} zend_end_try();

0 commit comments

Comments
 (0)