Browse Source

subckt.c, doit(), fix an ancient memory leak when use_numparams == FALSE

pre-master-46
rlar 12 years ago
parent
commit
7d44aa9564
  1. 5
      src/frontend/subckt.c

5
src/frontend/subckt.c

@ -618,15 +618,14 @@ doit(struct line *deck, wordlist *modnames) {
{
struct line *rest_of_c = c->li_next;
if (use_numparams == FALSE) {
/* old style: c will drop a dangling pointer: memory leak */
line_free_x(c, FALSE); /* drop the invocation */
if (prev_of_c)
prev_of_c->li_next = su_deck;
else
deck = su_deck;
} else {
/* ifdef NUMPARAMS, keep the invoke line as a comment */
c->li_line[0] = '*'; /* comment the invocation */
c->li_next = su_deck;
c->li_line[0] = '*'; /* comment it out */
}
c = su_deck;
while (c->li_next)

Loading…
Cancel
Save