]> granicus.if.org Git - php/commitdiff
Fixed memleak
authorXinchen Hui <laruence@php.net>
Wed, 11 Mar 2015 05:42:39 +0000 (13:42 +0800)
committerXinchen Hui <laruence@php.net>
Wed, 11 Mar 2015 05:42:39 +0000 (13:42 +0800)
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index b6d7442dbaa47fbc3320d81b7f05769acbc59923..5994380a7e27c27d2d4031e9e87fe8c580611042 100644 (file)
@@ -3241,6 +3241,14 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
                        EG(current_execute_data) = call->prev_execute_data;
                } else {
                        zend_error(E_EXCEPTION | E_ERROR, "Cannot call overloaded function for non-object");
+                       zend_vm_stack_free_args(call);
+
+                       zend_vm_stack_free_call_frame(call);
+
+                       if (fbc->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) {
+                               zend_string_release(fbc->common.function_name);
+                       }
+                       efree(fbc);
                        HANDLE_EXCEPTION();
                }
 
index 6180048915ebc7e8a70ac088d106c809e3c3c253..c3bf80d2bbd3ac9915193a0c9ab8a5dba3d041f9 100644 (file)
@@ -807,6 +807,14 @@ static int ZEND_FASTCALL  ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
                        EG(current_execute_data) = call->prev_execute_data;
                } else {
                        zend_error(E_EXCEPTION | E_ERROR, "Cannot call overloaded function for non-object");
+                       zend_vm_stack_free_args(call);
+
+                       zend_vm_stack_free_call_frame(call);
+
+                       if (fbc->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) {
+                               zend_string_release(fbc->common.function_name);
+                       }
+                       efree(fbc);
                        HANDLE_EXCEPTION();
                }