iliaa Fri Aug 8 19:50:36 2003 EDT
Modified files:
/php-src/ext/standard array.c
Log:
Fixed bug #24980 (array_reduce() uses first element as default running
total).
Fixed memory leak that can be replicated using the function example on
http://www.php.net/array_reduce
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.238 php-src/ext/standard/array.c:1.239
--- php-src/ext/standard/array.c:1.238 Tue Aug 5 06:29:03 2003
+++ php-src/ext/standard/array.c Fri Aug 8 19:50:36 2003
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: array.c,v 1.238 2003/08/05 10:29:03 zeev Exp $ */
+/* $Id: array.c,v 1.239 2003/08/08 23:50:36 iliaa Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -3374,7 +3374,9 @@
if (ZEND_NUM_ARGS() > 2) {
result = *initial;
- zval_add_ref(&result);
+ } else {
+ MAKE_STD_ZVAL(result);
+ ZVAL_LONG(result, 0);
}
/* (zval **)input points to an element of argument stack
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php