summaryrefslogtreecommitdiffhomepage
path: root/eval.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-10-19 23:20:17 +0200
committerJo-Philipp Wich <jo@mein.io>2020-10-19 23:36:09 +0200
commitd25f725e54c64f90786b1449e89b6232429e2d6d (patch)
tree795650b1cabd82e1232a96a88345ef874b3ef262 /eval.c
parent4636f4831c9430b1858d54539f0c0ddc1b4e564a (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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index d76af9b..0525bab 100644
--- a/eval.c
+++ b/eval.c
@@ -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);