diff options
| author | 2022-10-09 22:51:22 +0200 | |
|---|---|---|
| committer | 2022-10-09 22:51:22 +0200 | |
| commit | eeb528e62e47d1b3a76be949eccc24550cfc96d0 (patch) | |
| tree | 4b6772de72a0d19ff1ff6abefd4150b0e40a1c7e | |
| parent | 07392816b62731ba6226ca80dc3c7ba8147a50df (diff) | |
fix some memory leaks
| -rw-r--r-- | pez.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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; } |