From: Antony Dovgal Date: Fri, 21 Sep 2007 13:50:47 +0000 (+0000) Subject: plug leak on error (coverity issue #405) X-Git-Tag: RELEASE_2_0_0a1~1771 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cd519f058c2f4f5ace183e37ab69b89111a14d6e;p=php plug leak on error (coverity issue #405) --- diff --git a/ext/standard/array.c b/ext/standard/array.c index 68616f1188..8becac62c7 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -4477,6 +4477,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..e4dd279ff7 --- /dev/null +++ b/ext/standard/tests/array/array_map_001.phpt @@ -0,0 +1,27 @@ +--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 +--UEXPECTF-- +Warning: array_map(): An error occurred while invoking the map callback in %s on line %d +unicode(17) "exception caught!" +Done