From 84252fee5e485d0006ae9025849c59ea4d2f9fb7 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 14 Dec 2014 21:57:14 +0100 Subject: [PATCH] inpcom.c, cleanup `inp_fix_subckt()', use `line_free_x()' --- src/frontend/inpcom.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 8d1c3f191..18e37fe9c 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -2171,9 +2171,7 @@ inp_fix_subckt(struct names *subckt_w_params, char *s) inp_sort_params(first_param_card, head, NULL, NULL); /* create new ordered parameter string for subckt call */ - c = head->li_next; - tfree(head); - for (;c != NULL;) { + for (c = head->li_next; c; c = c->li_next) if (new_str == NULL) { new_str = strdup(c->li_line); } else { @@ -2181,11 +2179,8 @@ inp_fix_subckt(struct names *subckt_w_params, char *s) tfree(new_str); new_str = x; } - tfree(c->li_line); - head = c; - c = c->li_next; - tfree(head); - } + + line_free_x(head, TRUE); /* create buffer and insert params: */ buffer = tprintf("%s params: %s", s, new_str);