From 7b241027faf4c58f2ffea0e7de4948a719ffb5a8 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Wed, 2 Feb 2005 10:37:50 +0000 Subject: [PATCH] fix memory leak if function call fails --- ext/standard/array.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 93b9cd28ff..ba3f2aa103 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1093,7 +1093,10 @@ static int php_array_walk(HashTable *target_hash, zval **userdata, int recursive } else { 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; } -- 2.50.1