diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-10-19 23:20:17 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-10-19 23:36:09 +0200 |
commit | d25f725e54c64f90786b1449e89b6232429e2d6d (patch) | |
tree | 795650b1cabd82e1232a96a88345ef874b3ef262 /eval.c | |
parent | 4636f4831c9430b1858d54539f0c0ddc1b4e564a (diff) |
eval: fix leaking key value in object for-in loops
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -536,7 +536,7 @@ ut_execute_for(struct ut_state *state, uint32_t off) } else if (json_object_is_type(val, json_type_object)) { json_object_object_foreach(val, key, item) { - ut_setval(scope, iv, xjs_new_string(key)); + json_object_put(ut_setval(scope, iv, xjs_new_string(key))); json_object_put(rv); rv = ut_execute_op_sequence(state, body); |