We have to free the address when we're finished with it.
- 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.3.24
} else {
RETURN_FALSE;
}
+ mail_free_address(&addr);
}
/* }}} */
--- /dev/null
+--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>"