From 8946c27306abed7065afad3f015df5ee81e72ad2 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 1 May 2026 20:35:00 +0300 Subject: add support for coverage --- src/scope.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/scope.c') diff --git a/src/scope.c b/src/scope.c index 251edef..f350090 100644 --- a/src/scope.c +++ b/src/scope.c @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -22,7 +23,7 @@ struct scope *create_scope() /* if I ever try making the parser multithreaded, this should be atomic. */ static size_t counter = 0; - struct scope *scope = calloc(1, sizeof(struct scope)); + struct scope *scope = callocc(1, sizeof(struct scope)); if (!scope) { internal_error("ran out of memory allocating scope"); return NULL; @@ -42,11 +43,6 @@ void destroy_scope(struct scope *scope) if (!scope) return; - if (!scope->parent) { - free((void *)scope->fctx.fbuf); - free((void *)scope->fctx.fname); - } - foreach(mod_vec, m, &scope->mods) { dlclose(*m); } -- cgit v1.2.3