]> granicus.if.org Git - php/commitdiff
fix leak if function call fails
authorStanislav Malyshev <stas@php.net>
Wed, 2 Feb 2005 10:24:50 +0000 (10:24 +0000)
committerStanislav Malyshev <stas@php.net>
Wed, 2 Feb 2005 10:24:50 +0000 (10:24 +0000)
ext/standard/array.c

index 854247c3c607bda781c817d3269ca9785a17f672..ff3af2aa268c0b99c5c5ac55585eb889f93a503b 100644 (file)
@@ -1062,6 +1062,10 @@ static int php_array_walk(HashTable *target_hash, zval **userdata, int recursive
                                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s() - function does not exist", func_name);
                                }
 
+                               if (key) {
+                                       zval_ptr_dtor(&key);
+                                       key = NULL;
+                               }
                                efree(func_name);
                                break;
                        }