]> granicus.if.org Git - php/commitdiff
Fixed possible memory leak
authorDmitry Stogov <dmitry@php.net>
Tue, 6 May 2008 16:59:24 +0000 (16:59 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 6 May 2008 16:59:24 +0000 (16:59 +0000)
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index fc04af946860fc0a3199bf9c3a82ff378b704beb..e3fae90397bf9f5b179dfa3bfd2bb003dc670f75 100644 (file)
@@ -2632,7 +2632,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
        zend_uint arg_num = Z_LVAL(opline->op1.u.constant);
        zend_free_op free_res;
        zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
-       zval **var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W);;
+       zval **var_ptr;
 
        if (param == NULL) {
                ALLOC_ZVAL(assignment_value);
@@ -2650,6 +2650,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
        }
 
        zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC);
+       var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W);
        Z_DELREF_PP(var_ptr);
        *var_ptr = assignment_value;
 
index 9280fc88ba4dbe13a5d7c93eb107c21ec25512d8..381ac17dd1d6315ad70829a2a42bb97af6f7007f 100644 (file)
@@ -680,7 +680,7 @@ static int ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
        zend_uint arg_num = Z_LVAL(opline->op1.u.constant);
        zend_free_op free_res;
        zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
-       zval **var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W);;
+       zval **var_ptr;
 
        if (param == NULL) {
                ALLOC_ZVAL(assignment_value);
@@ -698,6 +698,7 @@ static int ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
        }
 
        zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC);
+       var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W);
        Z_DELREF_PP(var_ptr);
        *var_ptr = assignment_value;