]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #26847 (memory leak in mail() when to/subject contain only
authorIlia Alshanetsky <iliaa@php.net>
Fri, 9 Jan 2004 01:35:58 +0000 (01:35 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 9 Jan 2004 01:35:58 +0000 (01:35 +0000)
spaces).

NEWS
ext/standard/mail.c

diff --git a/NEWS b/NEWS
index 71a6f331ea79ff43201b247a3384657618762331..2cf4ca84b1459e383658cb91d2bce0a27ee37383 100644 (file)
--- 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)
index 8bb69facecae70df5302231a9947b35cf4223112..cab90301a5ee3eeecb01300f9f728e4c3673af62 100644 (file)
@@ -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);
        }
 }