Skip to content

Commit 518a160

Browse files
cmb69smalyshev
authored andcommitted
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.
1 parent 621598e commit 518a160

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

win32/sendmail.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,6 @@ PHPAPI int TSendMail(char *host, int *error, char **error_message,
208208
/* Create a lowercased header for all the searches so we're finally case
209209
* insensitive when searching for a pattern. */
210210
headers_lc = zend_string_tolower(headers_trim);
211-
if (headers_lc == headers_trim) {
212-
zend_string_release_ex(headers_lc, 0);
213-
}
214211
}
215212

216213
/* Fall back to sendmail_from php.ini setting */

0 commit comments

Comments
 (0)