tony2001                Thu Dec 23 11:35:48 2004 EDT

  Modified files:              
    /php-src/ext/standard       array.c 
  Log:
  destroy return_value and fix leak in array_fill()
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/array.c?r1=1.287&r2=1.288&ty=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.287 php-src/ext/standard/array.c:1.288
--- php-src/ext/standard/array.c:1.287  Thu Dec 16 14:13:58 2004
+++ php-src/ext/standard/array.c        Thu Dec 23 11:35:48 2004
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: array.c,v 1.287 2004/12/16 19:13:58 tony2001 Exp $ */
+/* $Id: array.c,v 1.288 2004/12/23 16:35:48 tony2001 Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -1542,6 +1542,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