]> git.kaiwu.me - njs.git/commitdiff
A fix of use-after-free memory bug.
authorIgor Sysoev <igor@sysoev.ru>
Thu, 15 Sep 2016 14:37:52 +0000 (17:37 +0300)
committerIgor Sysoev <igor@sysoev.ru>
Thu, 15 Sep 2016 14:37:52 +0000 (17:37 +0300)
njs/njs_vm.c

index 260e2be4b7021d9196feebd3aa6489bafaa83441..f85b40a067a40e1330bcbc78656b738ed1fad371 100644 (file)
@@ -2588,7 +2588,6 @@ njs_vmcode_continuation(njs_vm_t *vm, njs_value_t *invld1, njs_value_t *invld2)
         skip = frame->skip;
 
         vm->frame = njs_function_previous_frame(frame);
-        (void) njs_function_frame_free(vm, frame);
 
         /*
          * If a retval is in a callee arguments scope it
@@ -2606,6 +2605,7 @@ njs_vmcode_continuation(njs_vm_t *vm, njs_value_t *invld1, njs_value_t *invld2)
         }
 
         vm->current = cont->return_address;
+        (void) njs_function_frame_free(vm, frame);
 
         return 0;