Re: cvs: php4 /ext/imap php_imap.c
| From: | Andi Gutmans | Date: | Fri, 18 Aug 2000 13:28:52 +0000 |
| Subject: | Re: cvs: php4 /ext/imap php_imap.c | ||
| References: | 1 2 3 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-1220@lists.php.net to get a copy of this message | ||
At 07:59 AM 8/18/00 -0400, Chuck Hagenbuch wrote:
Quoting Andi Gutmans <andi@zend.com>: Are you sure this fix doesn't leak memory? No, I'm not - now that you mention it, it probably does (I'm not a c expert, sorry). However, mail_criteria appears to have side effects on the string passed to it, so with the high performance API, we can't just pass the pointer - a whole mess of things goes wrong and the variable you used to make the query gets munged so that you can't save it for use later. I can see two options: 1. Assign the cpystr to a new variable, pass that to mail_criteria, and free it at the end of the function - would free() or efree() be appropriate here?As you probably still want to stick to the high performance API for the other arguments you're best to estrndup() the string to a char * variable, pass that variable and then efree() it later on. Andi
2. Don't use the high performance API for imap_search. Does anyone prefer one of the two? Will the first actually work? -chuck -- Charles Hagenbuch, <chuck@horde.org> -- "You Will Be Serviced Like Never Before." - Columbia House advertisement -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-cvs-unsubscribe@lists.php.net For additional commands, e-mail: php-cvs-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net--- Andi Gutmans <andi@zend.com> http://www.zend.com/