From: foobar Date: Sun, 7 Jan 2001 07:47:46 +0000 (+0000) Subject: imap_user and imap_password were freed too early. X-Git-Tag: php-4.0.5RC1~705 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd2cd995cb0e7a3f8d24151f6c723eedae81a0d2;p=php imap_user and imap_password were freed too early. PR: 8424 --- diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index ca4b274a03..c2bd523977 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -71,7 +71,7 @@ void *fs_get(size_t size); int imap_mail(char *to, char *subject, char *message, char *headers, char *cc, char *bcc, char *rpath); -void mail_close_it(zend_rsrc_list_entry *rsrc); +void mail_close_it (zend_rsrc_list_entry *rsrc); #ifdef OP_RELOGIN /* AJS: close persistent connection */ void mail_userlogout_it(zend_rsrc_list_entry *rsrc); @@ -184,6 +184,9 @@ void mail_close_it(zend_rsrc_list_entry *rsrc) { pils *imap_le_struct = (pils *)rsrc->ptr; mail_close_full(imap_le_struct->imap_stream, imap_le_struct->flags); + + efree(IMAPG(imap_user)); + efree(IMAPG(imap_password)); efree(imap_le_struct); } @@ -766,8 +769,6 @@ void imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) } else { #endif imap_stream = mail_open(NIL, Z_STRVAL_PP(mailbox), flags); - efree(IMAPG(imap_user)); - efree(IMAPG(imap_password)); if (imap_stream == NIL) { php_error(E_WARNING, "Couldn't open stream %s\n", (*mailbox)->value.str.val);