tony2001 Thu Dec 16 14:13:59 2004 EDT
Modified files:
/php-src/ext/standard array.c
Log:
fix leak (init array only if we got valid start key)
http://cvs.php.net/diff.php/php-src/ext/standard/array.c?r1=1.286&r2=1.287&ty=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.286 php-src/ext/standard/array.c:1.287
--- php-src/ext/standard/array.c:1.286 Fri Dec 3 12:43:23 2004
+++ php-src/ext/standard/array.c Thu Dec 16 14:13:58 2004
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: array.c,v 1.286 2004/12/03 17:43:23 tony2001 Exp $ */
+/* $Id: array.c,v 1.287 2004/12/16 19:13:58 tony2001 Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -1519,13 +1519,13 @@
WRONG_PARAM_COUNT;
}
- /* allocate an array for return */
- array_init(return_value);
-
switch (Z_TYPE_PP(start_key)) {
case IS_STRING:
case IS_LONG:
case IS_DOUBLE:
+ /* allocate an array for return */
+ array_init(return_value);
+
if (PZVAL_IS_REF(*val)) {
SEPARATE_ZVAL(val);
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php