moriyoshi               Fri Jan  3 00:05:13 2003 EDT

  Modified files:              
    /php4/ext/standard  array.c 
  Log:
  Fixed small leaks in array_map() in case the first parameter is NULL like
  array_map(NULL, array(...));
  
  
Index: php4/ext/standard/array.c
diff -u php4/ext/standard/array.c:1.213 php4/ext/standard/array.c:1.214
--- php4/ext/standard/array.c:1.213     Tue Dec 31 11:07:31 2002
+++ php4/ext/standard/array.c   Fri Jan  3 00:05:12 2003
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: array.c,v 1.213 2002/12/31 16:07:31 sebastian Exp $ */
+/* $Id: array.c,v 1.214 2003/01/03 05:05:12 moriyoshi Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -3418,6 +3418,8 @@
                WRONG_PARAM_COUNT;
        }
 
+       RETVAL_NULL();
+
        callback = *args[0];
        if (Z_TYPE_P(callback) != IS_NULL) {
                if (!zend_is_callable(callback, 0, &callback_name)) {
@@ -3438,6 +3440,7 @@
                if (Z_TYPE_PP(args[i+1]) != IS_ARRAY) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d 
should be an array", i + 2);
                        efree(array_len);
+                       efree(array_pos);
                        efree(args);
                        return;
                }



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

Reply via email to