summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--ext/imap/php_imap.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 03dbfc93d5..588182a321 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@ PHP NEWS
- IMAP:
. Fixed bug #80213 (imap_mail_compose() segfaults on certain $bodies). (cmb)
. Fixed bug #80215 (imap_mail_compose() may modify by-val parameters). (cmb)
+ . Fixed bug #80220 (imap_mail_compose() may leak memory). (cmb)
- Opcache:
. Fixed bug #80184 (Complex expression in while / if statements resolves to
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index e3a90f525f..f08544284b 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -3264,7 +3264,7 @@ PHP_FUNCTION(imap_mail_compose)
convert_to_string_ex(pvalue);
bod->md5 = cpystr(Z_STRVAL_P(pvalue));
}
- } else if (Z_TYPE_P(data) == IS_ARRAY) {
+ } else if (Z_TYPE_P(data) == IS_ARRAY && topbod->type == TYPEMULTIPART) {
short type = -1;
SEPARATE_ARRAY(data);
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "type", sizeof("type") - 1)) != NULL) {