summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2019-12-10 18:43:01 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2019-12-17 09:32:28 +0100
commit11893c8e665d285f72c2b8a0fbe01a3fcc03b806 (patch)
treed3bd8f5bb23981cdeb95808706c57b642ab5fa00
parent36ac1671d57ef756aa93bcc26889d25c705858c2 (diff)
downloadphp-git-11893c8e665d285f72c2b8a0fbe01a3fcc03b806.tar.gz
Fix #78943: mail() may release string with refcount==1 twice
Since we need `headers_lc` as well as `headers_trim` in the following, we do not release the former even if they are the same string, to avoid complicating the release logic even more. A new test case is not necessary, since we already have mail_basic_alt2-win32.phpt and others. (cherry picked from commit 518a160b65fe1c535dc7e78972ba7428c2a4e197)
-rw-r--r--win32/sendmail.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/win32/sendmail.c b/win32/sendmail.c
index ea693ae1f9..273a3737c6 100644
--- a/win32/sendmail.c
+++ b/win32/sendmail.c
@@ -208,9 +208,6 @@ PHPAPI int TSendMail(char *host, int *error, char **error_message,
/* Create a lowercased header for all the searches so we're finally case
* insensitive when searching for a pattern. */
headers_lc = zend_string_tolower(headers_trim);
- if (headers_lc == headers_trim) {
- zend_string_release_ex(headers_lc, 0);
- }
}
/* Fall back to sendmail_from php.ini setting */