cvs: php-src(PHP_5_2) /ext/imap php_imap.c
| From: | Pierre-Alain Joye | Date: | Tue, 28 Apr 2009 12:43:10 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/imap php_imap.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-57351@lists.php.net to get a copy of this message | ||
pajoye Tue Apr 28 12:43:10 2009 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/imap php_imap.c
Log:
- MFH: SEARCHPGM struct has to be freed
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.49&r2=1.208.2.7.2.50&diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.49 php-src/ext/imap/php_imap.c:1.208.2.7.2.50
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.49 Tue Apr 28 08:33:25 2009
+++ php-src/ext/imap/php_imap.c Tue Apr 28 12:43:10 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates: Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_imap.c,v 1.208.2.7.2.49 2009/04/28 08:33:25 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.50 2009/04/28 12:43:10 pajoye Exp $ */
#define IMAP41
@@ -3685,6 +3685,7 @@
char *search_criteria;
MESSAGELIST *cur;
int argc = ZEND_NUM_ARGS();
+ SEARCHPGM *pgm = NIL;
if (argc < 2 || argc > 4 || zend_get_parameters_ex(argc, &streamind, &criteria,
&search_flags, &charset) == FAILURE) {
ZEND_WRONG_PARAM_COUNT();
@@ -3705,8 +3706,15 @@
}
}
+ pgm = mail_criteria(search_criteria);
IMAPG(imap_messages) = IMAPG(imap_messages_tail) = NIL;
- mail_search_full(imap_le_struct->imap_stream, (argc == 4 ? Z_STRVAL_PP(charset) : NIL),
mail_criteria(search_criteria), flags);
+
+ mail_search_full(imap_le_struct->imap_stream, (argc == 4 ? Z_STRVAL_PP(charset) : NIL), pgm,
flags);
+
+ if (pgm) {
+ mail_free_searchpgm(&pgm);
+ }
+
if (IMAPG(imap_messages) == NIL) {
efree(search_criteria);
RETURN_FALSE;
@@ -4315,6 +4323,7 @@
char criteria[] = "ALL";
THREADNODE *top;
int argc = ZEND_NUM_ARGS();
+ SEARCHPGM *pgm = NIL;
if ( argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &streamind, &search_flags)
== FAILURE) {
ZEND_WRONG_PARAM_COUNT();
@@ -4329,7 +4338,11 @@
flags = Z_LVAL_PP(search_flags);
}
- top = mail_thread(imap_le_struct->imap_stream, "REFERENCES", NIL,
mail_criteria(criteria), flags);
+ pgm = mail_criteria(criteria);
+ top = mail_thread(imap_le_struct->imap_stream, "REFERENCES", NIL, pgm, flags);
+ if (pgm) {
+ mail_free_searchpgm(&pgm);
+ }
if(top == NIL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function returned an empty tree");