summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-10-09 22:51:22 +0200
committerlemon <lsof@mailbox.org>2022-10-09 22:51:22 +0200
commiteeb528e62e47d1b3a76be949eccc24550cfc96d0 (patch)
tree4b6772de72a0d19ff1ff6abefd4150b0e40a1c7e
parent07392816b62731ba6226ca80dc3c7ba8147a50df (diff)
fix some memory leaks
-rw-r--r--pez.c5
1 files changed, 5 insertions, 0 deletions
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;
}