From eeb528e62e47d1b3a76be949eccc24550cfc96d0 Mon Sep 17 00:00:00 2001 From: lemon Date: Sun, 9 Oct 2022 22:51:22 +0200 Subject: fix some memory leaks --- pez.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pez.c b/pez.c index 2864444..2059387 100644 --- a/pez.c +++ b/pez.c @@ -1935,6 +1935,7 @@ static void deinitcomp(Comp *cm) { delfenv(cm->cx, &cm->fenv); + delvec(cm->cx, &cm->code); delvec(cm->cx, &cm->spool); delvec(cm->cx, &cm->kpool); } @@ -1958,6 +1959,8 @@ fincompfn(Comp *cm) if (pr->upval) { memcpy(pr->upval, cm->fenv.upvals, pr->nupval * sizeof(struct cmupval)); } + memset(&cm->code, 0, sizeof cm->code); + memset(&cm->con, 0, sizeof cm->con); return 1; } @@ -2423,6 +2426,8 @@ Cleanup: return ret && compclosure(cm, proto); Err: + delvec(cm->cx, &cm->code); + delvec(cm->cx, &cm->con); ret = 0; goto Cleanup; } -- cgit v1.2.3