]> granicus.if.org Git - php/commitdiff
Improve fix for #61165, the previous one cause #43450 test failed
authorXinchen Hui <laruence@php.net>
Sun, 26 Feb 2012 14:56:26 +0000 (14:56 +0000)
committerXinchen Hui <laruence@php.net>
Sun, 26 Feb 2012 14:56:26 +0000 (14:56 +0000)
Zend/zend_API.c

index 3b87145e6cd850b7c524ddac13ef19f6f43b4c62..9083e609c06d52101dbe2f6214659eccff6476c3 100644 (file)
@@ -255,14 +255,13 @@ static int parse_arg_object_to_string(zval **arg TSRMLS_DC) /* {{{ */
 {
        if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
                zval *obj;
-               ALLOC_ZVAL(obj);
-               MAKE_COPY_ZVAL(arg, obj);
+               MAKE_STD_ZVAL(obj);
                if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, obj, IS_STRING TSRMLS_CC) == SUCCESS) {
                        zval_ptr_dtor(arg);
                        *arg = obj;
                        return SUCCESS;
                }
-               zval_ptr_dtor(&obj);
+               efree(obj);
        }
        /* Standard PHP objects */
        if (Z_OBJ_HT_PP(arg) == &std_object_handlers || !Z_OBJ_HANDLER_PP(arg, cast_object)) {