From: Antony Dovgal Date: Fri, 21 Sep 2007 13:51:49 +0000 (+0000) Subject: MFH: plug leak on error (coverity issue #405) X-Git-Tag: php-5.2.5RC1~109 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=43cc8937b2e12a7c1b8359c81d4bba96376364a4;p=php MFH: plug leak on error (coverity issue #405) --- diff --git a/ext/standard/array.c b/ext/standard/array.c index 3b8195c964..41187efe47 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -4555,6 +4555,8 @@ PHP_FUNCTION(array_map) efree(args); efree(array_pos); zval_dtor(return_value); + zval_ptr_dtor(&null); + efree(params); RETURN_NULL(); } } diff --git a/ext/standard/tests/array/array_map_001.phpt b/ext/standard/tests/array/array_map_001.phpt new file mode 100644 index 0000000000..646eb7695e --- /dev/null +++ b/ext/standard/tests/array/array_map_001.phpt @@ -0,0 +1,23 @@ +--TEST-- +array_map() and exceptions in the callback +--FILE-- + +--EXPECTF-- +Warning: array_map(): An error occurred while invoking the map callback in %s on line %d +string(17) "exception caught!" +Done