From 95b9a70d57e05e30a92183921c2c8e8472d56dd8 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 6 Oct 2020 14:14:30 +0200 Subject: ast: fix refcount imbalance when releasing scopes Signed-off-by: Jo-Philipp Wich --- ast.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'ast.c') diff --git a/ast.c b/ast.c index 0a04892..21c2b65 100644 --- a/ast.c +++ b/ast.c @@ -381,15 +381,8 @@ ut_release_scope(struct ut_scope *sc) sc->refs--; - if (sc->refs == 0) { + if (sc->refs == 0) json_object_put(sc->scope); - sc->scope = NULL; - - if (sc->parent) { - ut_release_scope(json_object_get_userdata(sc->parent)); - sc->parent = NULL; - } - } } struct ut_scope * -- cgit v1.2.3