diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-10-15 12:55:44 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-10-15 12:56:02 +0200 |
commit | 7899ac4c14b6841d0e86a5003e7f7c6cd823d611 (patch) | |
tree | 352ad700f9d46e30b19e784dfebfdcbb0f554632 | |
parent | fb246bec142b19ec0329c964bd73b32566343661 (diff) | |
parent | 5941b30bb889afcdd7684f9e0ce05ce72bb8256b (diff) | |
download | php-git-7899ac4c14b6841d0e86a5003e7f7c6cd823d611.tar.gz |
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Fix #80239: imap_rfc822_write_address() leaks memory
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | ext/imap/php_imap.c | 1 | ||||
-rw-r--r-- | ext/imap/tests/imap_rfc822_write_address_basic.phpt | 12 |
3 files changed, 14 insertions, 0 deletions
@@ -4,6 +4,7 @@ PHP NEWS - IMAP: . Fixed bug #64076 (imap_sort() does not return FALSE on failure). (cmb) + . Fixed bug #80239 (imap_rfc822_write_address() leaks memory). (cmb) 29 Oct 2020, PHP 7.4.12 diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index fde64aeae1..9c8bb02514 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -2321,6 +2321,7 @@ PHP_FUNCTION(imap_subscribe) } else { RETURN_FALSE; } + mail_free_address(&addr); } /* }}} */ diff --git a/ext/imap/tests/imap_rfc822_write_address_basic.phpt b/ext/imap/tests/imap_rfc822_write_address_basic.phpt new file mode 100644 index 0000000000..92e988c9c9 --- /dev/null +++ b/ext/imap/tests/imap_rfc822_write_address_basic.phpt @@ -0,0 +1,12 @@ +--TEST-- +imap_rfc822_write_address() : basic functionality +--SKIPIF-- +<?php +if (!extension_loaded('imap')) die('skip imap extension not available'); +?> +--FILE-- +<?php +var_dump(imap_rfc822_write_address('me', 'example.com', 'My Name')); +?> +--EXPECT-- +string(24) "My Name <me@example.com>" |