diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-03-24 23:23:00 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-03-24 23:23:00 +0100 |
commit | 86e3970643e03a5e02f3eac2a52794bd6c040f30 (patch) | |
tree | 3553de9b4f6a3827691c1d9c1761b28362d8864d | |
parent | fe464eaa5ed78d0f1f0710b8523d7608a90ca3e1 (diff) |
lib: fix value refcount of uc_unshift() return value
The ref count of the unshifted value returned by uc_unshift() must be
increased in order to prevent a subsequent double free within the VM
when the value eventually goes out of scope.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -502,7 +502,7 @@ uc_unshift(uc_vm *vm, size_t nargs) json_object_array_put_idx(arr, arridx, uc_value_get(item)); } - return item; + return uc_value_get(item); } static json_object * |