]> granicus.if.org Git - php/commitdiff
Fix #78943: mail() may release string with refcount==1 twice
authorChristoph M. Becker <cmbecker69@gmx.de>
Tue, 10 Dec 2019 17:43:01 +0000 (18:43 +0100)
committerStanislav Malyshev <stas@php.net>
Sun, 15 Dec 2019 21:13:30 +0000 (13:13 -0800)
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.

win32/sendmail.c

index ea693ae1f96e53c8ebe2c0d6c89374b8ec0b5ae5..273a3737c677336a696df0bf3411ec909d894f13 100644 (file)
@@ -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 */