cvs: php-src(PHP_4_3) /ext/standard array.c
| From: | Antony Dovgal | Date: | Thu, 23 Dec 2004 16:40:03 +0000 |
| Subject: | cvs: php-src(PHP_4_3) /ext/standard array.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-29647@lists.php.net to get a copy of this message | ||
tony2001 Thu Dec 23 11:40:03 2004 EDT
Modified files: (Branch: PHP_4_3)
/php-src/ext/standard array.c
Log:
MFH: destroy return_value and fix leak in array_fill()
http://cvs.php.net/diff.php/php-src/ext/standard/array.c?r1=1.199.2.41&r2=1.199.2.42&ty=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.199.2.41 php-src/ext/standard/array.c:1.199.2.42
--- php-src/ext/standard/array.c:1.199.2.41 Thu Dec 16 14:23:59 2004
+++ php-src/ext/standard/array.c Thu Dec 23 11:40:03 2004
@@ -22,7 +22,7 @@
*/
-/* $Id: array.c,v 1.199.2.41 2004/12/16 19:23:59 tony2001 Exp $ */
+/* $Id: array.c,v 1.199.2.42 2004/12/23 16:40:03 tony2001 Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -1414,6 +1414,8 @@
convert_to_long_ex(num);
i = Z_LVAL_PP(num) - 1;
if (i < 0) {
+ zend_hash_destroy(Z_ARRVAL_P(return_value));
+ efree(Z_ARRVAL_P(return_value));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of elements must be positive");
RETURN_FALSE;
}