summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2004-12-23 16:35:48 +0000
committerAntony Dovgal <tony2001@php.net>2004-12-23 16:35:48 +0000
commit38d8e20f68234e7fdf2256327747e05e4b942bb2 (patch)
tree569a35d7be1652b238ef368ed1e579206c795d78 /ext
parent78edc7e65a2ccc1ac9bdf450aac99b20db5a8570 (diff)
downloadphp-git-38d8e20f68234e7fdf2256327747e05e4b942bb2.tar.gz
destroy return_value and fix leak in array_fill()
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/array.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 587fc92b16..93b9cd28ff 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -1542,6 +1542,8 @@ PHP_FUNCTION(array_fill)
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;
}