summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-01-09 01:35:58 +0000
committerIlia Alshanetsky <iliaa@php.net>2004-01-09 01:35:58 +0000
commit9058adacc80413f93dab2f7f7514c83d333217a1 (patch)
treec4bcae5b0a59d0ecf0b72495a33e64fe086398e3
parentab99e924507cd45d6a80a215aca5011e8a674fb6 (diff)
downloadphp-git-9058adacc80413f93dab2f7f7514c83d333217a1.tar.gz
MFH: Fixed bug #26847 (memory leak in mail() when to/subject contain only
spaces).
-rw-r--r--NEWS2
-rw-r--r--ext/standard/mail.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 71a6f331ea..2cf4ca84b1 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,8 @@ PHP 4 NEWS
- Added a warning when creating temp stream fails with ftp_(n)list(). (Sara)
- Fixed header handler in NSAPI SAPI module (header->replace was ignored,
send_default_content_type now sends value from php.ini). (Uwe Schindler)
+- Fixed bug #26847 (memory leak in mail() when to/subject contain only spaces).
+ (Ilia)
- Fixed bug #26777 (ext/interbase: Let DB handle NULL params). (Ard)
- Fixed bug #26755 (CLI now overrides php.ini settings and switches off
output buffering). (Edin)
diff --git a/ext/standard/mail.c b/ext/standard/mail.c
index 8bb69facec..cab90301a5 100644
--- a/ext/standard/mail.c
+++ b/ext/standard/mail.c
@@ -157,10 +157,10 @@ PHP_FUNCTION(mail)
if (extra_cmd) {
efree (extra_cmd);
}
- if (to_len > 0) {
+ if (to_r != to) {
efree(to_r);
}
- if (subject_len > 0) {
+ if (subject_r != subject) {
efree(subject_r);
}
}