]> granicus.if.org Git - php/commitdiff
- #47940, memory leaks in imap_body
authorPierre Joye <pajoye@php.net>
Thu, 30 Apr 2009 18:55:44 +0000 (18:55 +0000)
committerPierre Joye <pajoye@php.net>
Thu, 30 Apr 2009 18:55:44 +0000 (18:55 +0000)
NEWS
ext/imap/php_imap.c

diff --git a/NEWS b/NEWS
index e42296e86ffedb456e97d7e51bda6af211871885..9d79372b5e771f61d3b946d5fce325536c7d4a5d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,7 @@ PHP                                                                        NEWS
 - Fixed bug #47969 (ezmlm_hash() returns different values depend on OS).
   (Ilia)
 - Fixed bug #47946 (ImageConvolution overwrites background). (Ilia)
+- Fixed bug #47940 (memory leaks in imap_body). (Pierre, Jake Levitt)
 - Fixed bug #47937 (system() calls sapi_flush() regardless of output
   buffering). (Ilia)
 - Fixed bug #47903 ("@" operator does not work with string offsets). (Felipe)
index a2ba16df7c038ec03339d50926ad97d24b1076cf..ea4e8d5761b0806c18ccb0b898d94f616eb5c1eb 100644 (file)
@@ -487,7 +487,7 @@ PHP_MINIT_FUNCTION(imap)
        REGISTER_LONG_CONSTANT("NIL", NIL, CONST_PERSISTENT | CONST_CS);
 
        /* plug in our gets */
-       mail_parameters(NIL, SET_GETS, (void *) php_mail_gets);
+       mail_parameters(NIL, SET_GETS, (void *) NIL);
 
        /* set default timeout values */
        mail_parameters(NIL, SET_OPENTIMEOUT, (void *) FG(default_socket_timeout));
@@ -1266,7 +1266,6 @@ PHP_FUNCTION(imap_body)
        } else {
                RETVAL_STRINGL(body, body_len, 1);
        }
-       free(body);
 }
 /* }}} */
 
@@ -1995,7 +1994,9 @@ PHP_FUNCTION(imap_savebody)
        }
 
        IMAPG(gets_stream) = writer;
+       mail_parameters(NIL, SET_GETS, (void *) php_mail_gets);
        mail_fetchbody_full(imap_ptr->imap_stream, msgno, section, NULL, flags);
+       mail_parameters(NIL, SET_GETS, (void *) NIL);
        IMAPG(gets_stream) = NULL;
 
        if (close_stream) {