From 1e4c6f566543ed245253421cbe003b7b22563e2e Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 2 Oct 2020 21:20:47 +0200 Subject: eval: free previous exception when storing a new one Signed-off-by: Jo-Philipp Wich --- eval.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'eval.c') 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; -- cgit v1.2.3