diff --git a/src/frontend/inp.c b/src/frontend/inp.c index cec1978f7..fb560bb11 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -1589,6 +1589,20 @@ inp_parse_temper_trees(struct circ *circ) } +void +rem_tlist(struct pt_temper *p) +{ + while (p) { + struct pt_temper *next_p = p->next; + tfree(p->expression); + wl_free(p->wl); + INPfreeTree((IFparseTree *) p->pt); + tfree(p); + p = next_p; + } +} + + void inp_evaluate_temper(struct circ *circ) { diff --git a/src/frontend/runcoms2.c b/src/frontend/runcoms2.c index 50f92392d..95ce71379 100644 --- a/src/frontend/runcoms2.c +++ b/src/frontend/runcoms2.c @@ -257,6 +257,8 @@ com_remcirc(wordlist *wl) tfree(ft_curckt->ci_name); if (ft_curckt->ci_filename) tfree(ft_curckt->ci_filename); + rem_tlist(ft_curckt->devtlist); + rem_tlist(ft_curckt->modtlist); /* delete the actual circuit entry from ft_circuits */ for (p = ft_circuits; p; p = p->ci_next) { diff --git a/src/include/ngspice/fteext.h b/src/include/ngspice/fteext.h index 0bd5e28fd..afb992352 100644 --- a/src/include/ngspice/fteext.h +++ b/src/include/ngspice/fteext.h @@ -219,6 +219,7 @@ extern struct line *line_nconc(struct line *head, struct line *rest); extern struct line *line_reverse(struct line *head); extern char **circarray; +extern void rem_tlist(struct pt_temper *p); /* nutinp.c */