diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-03-25 17:57:42 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-03-25 19:07:56 +0100 |
commit | 20a3763d0a9a5efe6478595fe5590d47bffa90fe (patch) | |
tree | 4c10486ce56eab49c032771dfac778acbc7a6c1b | |
parent | 9a6ef2bf3f9d0cabe39a05c72f70fc1799258c0f (diff) |
vm: fix loop variable memory leak in NEXTK/NEXTKV instruction
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | vm.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1749,6 +1749,7 @@ uc_vm_insn_next(uc_vm *vm, enum insn_type insn) uc_vm_stack_push(vm, uc_value_get((json_object *)curr->v)); uc_vm_stack_push(vm, k); + uc_value_put(v); return; } @@ -1770,10 +1771,13 @@ uc_vm_insn_next(uc_vm *vm, enum insn_type insn) uc_vm_stack_push(vm, uc_value_get(json_object_array_get_idx(v, n))); uc_vm_stack_push(vm, k); + uc_value_put(v); return; } + uc_value_put(k); + break; default: @@ -1785,6 +1789,8 @@ uc_vm_insn_next(uc_vm *vm, enum insn_type insn) if (insn == I_NEXTKV) uc_vm_stack_push(vm, NULL); + + uc_value_put(v); } static void |