From: George Peter Banyard Date: Thu, 22 Oct 2020 16:01:48 +0000 (+0100) Subject: Fix bug 76618 X-Git-Tag: php-7.3.25RC1~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12a09183b369779fcf123cdd4fbacee373cc7d98;p=php Fix bug 76618 Apply patch which was attached to the bug in July 2018 --- diff --git a/NEWS b/NEWS index 6af9c20676..31427b1b2d 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ PHP NEWS - IMAP: . Fixed bug #64076 (imap_sort() does not return FALSE on failure). (cmb) + . Fixed bug #76618 (segfault on imap_reopen). (girgias) . Fixed bug #80239 (imap_rfc822_write_address() leaks memory). (cmb) . Fixed minor regression caused by fixing bug #80220. (cmb) . Fixed bug #80242 (imap_mail_compose() segfaults for multipart with rfc822). diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index cf8ed7bcf2..7725f36f0e 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -1315,7 +1315,7 @@ PHP_FUNCTION(imap_reopen) imap_le_struct->imap_stream = mail_open(imap_le_struct->imap_stream, ZSTR_VAL(mailbox), flags); if (imap_le_struct->imap_stream == NIL) { - zend_list_delete(Z_RES_P(streamind)); + zend_list_close(Z_RES_P(streamind)); php_error_docref(NULL, E_WARNING, "Couldn't re-open stream"); RETURN_FALSE; }