mirror of
https://github.com/php/php-src.git
synced 2026-04-23 07:58:20 +02:00
Merge branch 'PHP-8.0' into master
* PHP-8.0: Fix #80226: imap_sort() leaks sortpgm memory
This commit is contained in:
@@ -2742,6 +2742,7 @@ PHP_FUNCTION(imap_sort)
|
||||
|
||||
slst = mail_sort(imap_le_struct->imap_stream, (charset ? ZSTR_VAL(charset) : NIL), spg, mypgm, flags);
|
||||
|
||||
mail_free_sortpgm(&mypgm);
|
||||
if (spg && !(flags & SE_FREE)) {
|
||||
mail_free_searchpgm(&spg);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #80226 (imap_sort() leaks sortpgm memory)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(__DIR__.'/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once(__DIR__.'/imap_include.inc');
|
||||
$stream = imap_open($default_mailbox, $username, $password);
|
||||
imap_sort($stream, SORTFROM, 0);
|
||||
?>
|
||||
--EXPECT--
|
||||
Reference in New Issue
Block a user