summaryrefslogtreecommitdiff
path: root/ext/imap/php_imap.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-10-12 13:26:38 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-10-12 15:08:30 +0200
commitc1962e900a4ebe74a6e7578e3da75a0931687546 (patch)
tree979bb1238a8f0848ad732da77e3402c63047edef /ext/imap/php_imap.c
parent0d022ddf03c5fabaaa22e486d1e4a367ed9170a7 (diff)
downloadphp-git-c1962e900a4ebe74a6e7578e3da75a0931687546.tar.gz
Fix #80223: imap_mail_compose() leaks envelope on malformed bodies
We have to clean up even on failure. Closes GH-6322.
Diffstat (limited to 'ext/imap/php_imap.c')
-rw-r--r--ext/imap/php_imap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index 0cf350e907..63b5464808 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -3622,7 +3622,8 @@ PHP_FUNCTION(imap_mail_compose)
if (Z_TYPE_P(data) != IS_ARRAY) {
php_error_docref(NULL, E_WARNING, "body parameter must be a non-empty array");
- RETURN_FALSE;
+ RETVAL_FALSE;
+ goto done;
}
SEPARATE_ARRAY(data);
@@ -3824,7 +3825,8 @@ PHP_FUNCTION(imap_mail_compose)
if (first) {
php_error_docref(NULL, E_WARNING, "body parameter must be a non-empty array");
- RETURN_FALSE;
+ RETVAL_FALSE;
+ goto done;
}
if (bod && bod->type == TYPEMULTIPART && (!bod->nested.part || !bod->nested.part->next)) {