Skip to content

Commit 7899ac4

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #80239: imap_rfc822_write_address() leaks memory
2 parents fb246be + 5941b30 commit 7899ac4

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ PHP NEWS
44

55
- IMAP:
66
. Fixed bug #64076 (imap_sort() does not return FALSE on failure). (cmb)
7+
. Fixed bug #80239 (imap_rfc822_write_address() leaks memory). (cmb)
78

89
29 Oct 2020, PHP 7.4.12
910

ext/imap/php_imap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2321,6 +2321,7 @@ PHP_FUNCTION(imap_subscribe)
23212321
} else {
23222322
RETURN_FALSE;
23232323
}
2324+
mail_free_address(&addr);
23242325
}
23252326
/* }}} */
23262327

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)