Skip to content

Commit 42d6844

Browse files
committed
Merge branch 'PHP-8.0' into master
* PHP-8.0: Fix #80239: imap_rfc822_write_address() leaks memory
2 parents a717072 + b7c1834 commit 42d6844

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

ext/imap/php_imap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,6 +1849,7 @@ PHP_FUNCTION(imap_subscribe)
18491849
} else {
18501850
RETURN_FALSE;
18511851
}
1852+
mail_free_address(&addr);
18521853
}
18531854
/* }}} */
18541855

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
imap_rfc822_write_address() : basic functionality
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded('imap')) die('skip imap extension not available');
6+
?>
7+
--FILE--
8+
<?php
9+
var_dump(imap_rfc822_write_address('me', 'example.com', 'My Name'));
10+
?>
11+
--EXPECT--
12+
string(24) "My Name <me@example.com>"

0 commit comments

Comments
 (0)