diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-10-15 12:58:07 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-10-15 12:58:07 +0200 |
commit | 42d68443587d6fa982239bae8b377226f421a6bf (patch) | |
tree | d2c02a093403061b73c4ed6109a5b7374a8dc0d2 /ext | |
parent | a7170727b56aa04ccf30275dfd1bcaf4fc8de955 (diff) | |
parent | b7c1834c6aafd4f423629cf6719084dd16ba7030 (diff) | |
download | php-git-42d68443587d6fa982239bae8b377226f421a6bf.tar.gz |
Merge branch 'PHP-8.0' into master
* PHP-8.0:
Fix #80239: imap_rfc822_write_address() leaks memory
Diffstat (limited to 'ext')
-rw-r--r-- | ext/imap/php_imap.c | 1 | ||||
-rw-r--r-- | ext/imap/tests/imap_rfc822_write_address_basic.phpt | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index 4597fdbe3c..35253b23f8 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -1849,6 +1849,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>" |