Skip to content

[Mailer] Fix Sendmail memory leak #59256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ protected function doSend(SentMessage $message): void
$this->stream->setCommand($command);
$this->stream->initialize();
foreach ($chunks as $chunk) {
$this->stream->write($chunk);
$this->stream->write($chunk, false);
Copy link
Member

@nicolas-grekas nicolas-grekas Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For next reviewers: this sets the debug flag, so that the stream instance doesn't keep a string copy of what was written. This debug info is not accessible anywhere anyway.
That's similar to:
https://github.com/rch7/symfony/blob/c74e2a3d7e1df817b2bea7d8f6a8fc3373c445bb/src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php#L222

}
$this->stream->flush();
$this->stream->terminate();
Expand Down
Loading