From: Antony Dovgal Date: Thu, 23 Dec 2004 16:38:13 +0000 (+0000) Subject: MFH: destroy return_value and fix leak in array_fill() X-Git-Tag: php-5.0.4RC1~437 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39acd18e4b043fd2d9fac823cfca9ed59d75b02f;p=php MFH: destroy return_value and fix leak in array_fill() --- diff --git a/ext/standard/array.c b/ext/standard/array.c index efe26cdec6..854247c3c6 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1510,6 +1510,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; }