Skip to content

ext/intl: Memory leaks when MessageFormatter::parseMessage() fails #19261

Description

@Girgias

Description

The following code:

--TEST--
MessageFormatter::parseMessage() with invalid locale
--EXTENSIONS--
intl
--FILE--
<?php

$locale = 'root';
$fmt = '{0,whatever} would not work!';

$str = 'failing';

$m = MessageFormatter::parseMessage($locale, $fmt, $str);
var_dump($m);
var_dump(intl_get_error_message());

$m = msgfmt_parse_message($locale, $fmt, $str);
var_dump($m);
var_dump(intl_get_error_message());

?>

leaks memory if ran under ASAN.

Found while working on #19196

PHP Version

master, but probably 8.3 and lower too

Operating System

No response

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions