From 63d3c28d601d7c85ad5e364d59e8aa4b713caaf4 Mon Sep 17 00:00:00 2001 From: rlar Date: Tue, 6 Mar 2012 21:26:26 +0100 Subject: [PATCH] doit, shrink scope of `savenext' --- src/frontend/subckt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index d20bffd30..fc4884ae7 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -397,7 +397,6 @@ inp_subcktexpand(struct line *deck) { static struct line * doit(struct line *deck) { struct line *c, *last, *lc, *lcc; - struct line *savenext; struct subs *sssfree = NULL, *sss = NULL, *ks; /* *sss and *ks temporarily hold decks to substitute */ char *s, *t, *scname, *subname; int nest, numpasses = MAXNEST, i; @@ -604,7 +603,8 @@ doit(struct line *deck) { tfree(subname); /* Now splice the decks together. */ - savenext = c->li_next; + { + struct line *savenext = c->li_next; if ( use_numparams==FALSE ) { /* old style: c will drop a dangling pointer: memory leak */ if (lc) @@ -620,6 +620,7 @@ doit(struct line *deck) { lcc = lcc->li_next; lcc->li_next = c->li_next; lcc->li_next = savenext; + } c = lcc->li_next; lc = lcc; tfree(tofree);