cvs: pecl /mailparse mailparse.c /mailparse/tests 008.phpt
| From: | Brian Shire | Date: | Tue, 04 Sep 2007 19:43:27 +0000 |
| Subject: | cvs: pecl /mailparse mailparse.c /mailparse/tests 008.phpt | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-8508@lists.php.net to get a copy of this message | ||
shire Tue Sep 4 19:43:27 2007 UTC
Modified files:
/pecl/mailparse mailparse.c
/pecl/mailparse/tests 008.phpt
Log:
fixing memory leaks and deprecated code in tests. (All tests should pass now.)
http://cvs.php.net/viewvc.cgi/pecl/mailparse/mailparse.c?r1=1.49&r2=1.50&diff_format=u
Index: pecl/mailparse/mailparse.c
diff -u pecl/mailparse/mailparse.c:1.49 pecl/mailparse/mailparse.c:1.50
--- pecl/mailparse/mailparse.c:1.49 Thu May 12 13:02:41 2005
+++ pecl/mailparse/mailparse.c Tue Sep 4 19:43:27 2007
@@ -15,7 +15,7 @@
| Author: Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: mailparse.c,v 1.49 2005/05/12 13:02:41 wez Exp $ */
+/* $Id: mailparse.c,v 1.50 2007/09/04 19:43:27 shire Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -200,6 +200,7 @@
MAKE_STD_ZVAL(tmp);
mailparse_get_part_data(part, tmp TSRMLS_CC);
add_property_zval(object, "data", tmp);
+ ZVAL_DELREF(tmp);
return SUCCESS;
}
@@ -656,7 +657,7 @@
php_info_print_table_start();
php_info_print_table_header(2, "mailparse support", "enabled");
php_info_print_table_row(2, "Extension Version", mailparse_module_entry.version);
- php_info_print_table_row(2, "Revision", "$Revision: 1.49 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.50 $");
php_info_print_table_end();
DISPLAY_INI_ENTRIES();
@@ -1399,6 +1400,7 @@
if (SUCCESS == zend_hash_find(Z_ARRVAL_P(headers), headerkey, strlen(headerkey)+1,
(void**)&headerval)) {
MAKE_STD_ZVAL(newhdr);
*newhdr = **headerval;
+ newhdr->refcount = 1;
zval_copy_ctor(newhdr);
add_assoc_zval(return_value, headerkey, newhdr);
}
http://cvs.php.net/viewvc.cgi/pecl/mailparse/tests/008.phpt?r1=1.1&r2=1.2&diff_format=u
Index: pecl/mailparse/tests/008.phpt
diff -u pecl/mailparse/tests/008.phpt:1.1 pecl/mailparse/tests/008.phpt:1.2
--- pecl/mailparse/tests/008.phpt:1.1 Tue Sep 10 13:22:47 2002
+++ pecl/mailparse/tests/008.phpt Tue Sep 4 19:43:27 2007
@@ -10,7 +10,7 @@
--FILE--
<?php
error_reporting(0);
-$msg = & new MimeMessage("file", md5(uniqid("nothere")));
+$msg = new MimeMessage("file", md5(uniqid("nothere")));
if (is_resource($msg))
echo "Err??";
else