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

This commit is contained in:
rlar 2014-07-18 18:08:27 +02:00
parent f2abbf1528
commit 7d44aa9564
1 changed files with 2 additions and 3 deletions

View File

@ -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)