Skip to content

Commit 1a840b9

Browse files
committed
fix double free
1 parent e2609a3 commit 1a840b9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ext/intl/msgformat/msgformat_format.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@ static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *ret
5151
zend_hash_destroy(args_copy);
5252
efree(args_copy);
5353

54-
if (formatted && U_FAILURE(INTL_DATA_ERROR_CODE(mfo))) {
55-
efree(formatted);
56-
}
57-
5854
if (U_FAILURE(INTL_DATA_ERROR_CODE(mfo))) {
55+
if (formatted) {
56+
efree(formatted);
57+
}
5958
RETURN_FALSE;
6059
} else {
6160
INTL_METHOD_RETVAL_UTF8(mfo, formatted, formatted_len, 1);

0 commit comments

Comments
 (0)