diff options
Diffstat (limited to 'src/scope.c')
| -rw-r--r-- | src/scope.c | 8 |
1 files changed, 2 insertions, 6 deletions
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 <stdio.h> #include <dlfcn.h> +#include <fwd/coverage.h> #include <fwd/debug.h> #include <fwd/scope.h> @@ -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); } |
