diff --git a/src/frontend/inp.c b/src/frontend/inp.c index 2b88454c5..83faa4fd1 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -1833,19 +1833,9 @@ inp_parse_temper_trees(struct circ *circ) /* remove the actual modtlist and devtlist */ void -rem_tlist(struct circ *circ) +rem_tlist(struct pt_temper *p) { - struct pt_temper *p; - - for (p = circ->devtlist; p;) { - struct pt_temper *next_p = p->next; - tfree(p->expression); - wl_free(p->wl); - INPfreeTree((IFparseTree *) p->pt); - tfree(p); - p = next_p; - } - for (p = circ->modtlist; p;) { + while (p) { struct pt_temper *next_p = p->next; tfree(p->expression); wl_free(p->wl); diff --git a/src/frontend/runcoms2.c b/src/frontend/runcoms2.c index dd3798279..91efd3e49 100644 --- a/src/frontend/runcoms2.c +++ b/src/frontend/runcoms2.c @@ -259,7 +259,8 @@ com_remcirc(wordlist *wl) tfree(ft_curckt->ci_name); if (ft_curckt->ci_filename) tfree(ft_curckt->ci_filename); - rem_tlist(ft_curckt); + 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 427da7e91..8df6f3897 100644 --- a/src/include/ngspice/fteext.h +++ b/src/include/ngspice/fteext.h @@ -221,7 +221,7 @@ extern void mc_free(void); void eval_seed_opt(struct line *deck); extern char** circarray; -extern void rem_tlist(struct circ *curckt); +extern void rem_tlist(struct pt_temper *p); /* nutinp.c */