- fix garbage cleanup crash in http_parse_params() with PHP4
authorMichael Wallner <mike@php.net>
Fri, 28 Sep 2007 09:54:15 +0000 (09:54 +0000)
committerMichael Wallner <mike@php.net>
Fri, 28 Sep 2007 09:54:15 +0000 (09:54 +0000)
  (add_property_zval in ZE2 automatically increases refcount while ZE1 doesn't)

http_functions.c

index 1f94df95a317757f252acb79f417cfe69acdced2..4527c25388f0f8b16a0d215513e7d52649a76a14 100644 (file)
@@ -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(&params);
                RETURN_FALSE;
        }
+       
        object_init(return_value);
        add_property_zval(return_value, "params", params);
+#ifdef ZEND_ENGINE_2
+       zval_ptr_dtor(&params);
+#endif
 }
 /* }}} */