summaryrefslogtreecommitdiffhomepage
path: root/eval.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-10-02 21:20:47 +0200
committerJo-Philipp Wich <jo@mein.io>2020-10-02 21:20:47 +0200
commit1e4c6f566543ed245253421cbe003b7b22563e2e (patch)
treeb2c6375b8872361da87895520ee67cc6414b26d8 /eval.c
parent00c2c35a7204a41ce8d76ee80dc877746a87af5d (diff)
eval: free previous exception when storing a new one
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index caa46d6..cfee806 100644
--- a/eval.c
+++ b/eval.c
@@ -49,6 +49,9 @@ ut_exception(struct ut_state *state, uint32_t off, const char *fmt, ...)
json_object_set_userdata(msg, exception_tag, NULL);
+ if (state->error.code == UT_ERROR_EXCEPTION)
+ json_object_put(state->error.info.exception);
+
state->error.code = UT_ERROR_EXCEPTION;
state->error.info.exception = msg;