From: Michael Wallner Date: Fri, 28 Sep 2007 09:54:15 +0000 (+0000) Subject: - fix garbage cleanup crash in http_parse_params() with PHP4 X-Git-Tag: RELEASE_1_6_0RC1~7 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=a3550dfdf5079087b74c28470cccaa59ed7712b4;p=m6w6%2Fext-http - fix garbage cleanup crash in http_parse_params() with PHP4 (add_property_zval in ZE2 automatically increases refcount while ZE1 doesn't) --- diff --git a/http_functions.c b/http_functions.c index 1f94df9..4527c25 100644 --- a/http_functions.c +++ b/http_functions.c @@ -733,15 +733,18 @@ PHP_FUNCTION(http_parse_params) RETURN_FALSE; } - params = ecalloc(1, sizeof(zval)); + MAKE_STD_ZVAL(params); array_init(params); if (SUCCESS != http_parse_params(param, flags, Z_ARRVAL_P(params))) { - zval_dtor(params); - FREE_ZVAL(params); + zval_ptr_dtor(¶ms); RETURN_FALSE; } + object_init(return_value); add_property_zval(return_value, "params", params); +#ifdef ZEND_ENGINE_2 + zval_ptr_dtor(¶ms); +#endif } /* }}} */