tony2001                Thu Dec 23 11:38:14 2004 EDT

  Modified files:              (Branch: PHP_5_0)
    /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.266.2.10&r2=1.266.2.11&ty=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.266.2.10 
php-src/ext/standard/array.c:1.266.2.11
--- php-src/ext/standard/array.c:1.266.2.10     Thu Dec 16 14:20:54 2004
+++ php-src/ext/standard/array.c        Thu Dec 23 11:38:13 2004
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: array.c,v 1.266.2.10 2004/12/16 19:20:54 tony2001 Exp $ */
+/* $Id: array.c,v 1.266.2.11 2004/12/23 16:38:13 tony2001 Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -1510,6 +1510,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;
        }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to