summaryrefslogtreecommitdiffhomepage
path: root/ast.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-10-06 14:14:30 +0200
committerJo-Philipp Wich <jo@mein.io>2020-10-06 15:02:28 +0200
commit95b9a70d57e05e30a92183921c2c8e8472d56dd8 (patch)
treeada21be7bc7f42af66bca4938ec3988c3d6f35d3 /ast.c
parentbae96955c502350a6ec90e47b60e1f5d7f460477 (diff)
ast: fix refcount imbalance when releasing scopes
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'ast.c')
-rw-r--r--ast.c9
1 files changed, 1 insertions, 8 deletions
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 *