From: Ilia Alshanetsky Date: Fri, 9 Jan 2004 01:35:58 +0000 (+0000) Subject: MFH: Fixed bug #26847 (memory leak in mail() when to/subject contain only X-Git-Tag: php-4.3.5RC1~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9058adacc80413f93dab2f7f7514c83d333217a1;p=php MFH: Fixed bug #26847 (memory leak in mail() when to/subject contain only spaces). --- 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); } }