]> 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 4c0e0f6b2fa678542180ba5f80ec2407742c1ab0..1c608a7a30e4bba1b5c0a8f7f92e85d03b678ede 100644 (file)
@@ -263,8 +263,7 @@ static int parse_arg_object_to_string(zval **arg, char **p, int *pl, int type TS
 {
        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, type TSRMLS_CC) == SUCCESS) {
                        zval_ptr_dtor(arg);
                        *arg = obj;
@@ -272,7 +271,7 @@ static int parse_arg_object_to_string(zval **arg, char **p, int *pl, int type TS
                        *p = Z_STRVAL_PP(arg);
                        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)) {