From 2f8a646d4e68d3f515d0b5275d179562a219a9ed Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 18 Mar 2004 12:23:31 +0000 Subject: 19655, 19656, 19657: Memory leaks spotted by valgrind. Also bug with multiple math function autoloads. --- Src/exec.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Src/exec.c') diff --git a/Src/exec.c b/Src/exec.c index bb4194d52..4bd6503bf 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -2519,6 +2519,10 @@ save_params(Estate state, Wordcode pc, LinkList *restore_p, LinkList *remove_p) while (wc_code(ac = *pc) == WC_ASSIGN) { s = ecrawstr(state->prog, pc + 1, NULL); if ((pm = (Param) paramtab->getnode(paramtab, s))) { + if (pm->env) { + delenv(pm->env); + pm->env = NULL; + } if (!(pm->flags & PM_SPECIAL)) { paramtab->removenode(paramtab, s); } else if (!(pm->flags & PM_READONLY) && -- cgit v1.2.3