Re: cvs: php4 /ext/imap php_imap.c
| From: | Chuck Hagenbuch | Date: | Fri, 18 Aug 2000 11:59:38 +0000 |
| Subject: | Re: cvs: php4 /ext/imap php_imap.c | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-1214@lists.php.net to get a copy of this message | ||
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?
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