Skip to content

Commit c93f854

Browse files
committed
W.I.P. Fix memory leak in ext/intl
1 parent 3d944a3 commit c93f854

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/intl/msgformat/msgformat_format.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ PHP_FUNCTION( msgfmt_format_message )
124124
if(spattern && spattern_len) {
125125
efree(spattern);
126126
}
127+
if (U_FAILURE(INTL_DATA_ERROR_CODE(mfo))) {
128+
intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
129+
"msgfmt_format_message: error converting pattern to quote-friendly format", 0 );
130+
umsg_close(MSG_FORMAT_OBJECT(mfo));
131+
RETURN_FALSE;
132+
}
127133

128134
if (INTL_DATA_ERROR_CODE( mfo ) == U_PATTERN_SYNTAX_ERROR) {
129135
char *msg = NULL;

0 commit comments

Comments
 (0)