From 8930690cd26f19dbb98440d2dcec9b45a20075ab Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 22 Jul 2018 09:53:14 +0200 Subject: [PATCH] plug a small memory leak --- src/frontend/inpcom.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 6d9b6c9e8..c65c26336 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -4513,7 +4513,7 @@ inp_compat(struct card *card) BGxxx int1 0 V = pwl (expression, x0-(x2-x0)/2, y0, x0, y0, x1, y1, x2, y2, x2+(x2-x0)/2, y2) */ if ((str_ptr = strstr(curr_line, "table")) != NULL) { - char *expression, *firstno, *ffirstno, *secondno, *midline, *lastno, *lastlastno; + char *expression, *firstno, *ffirstno, *ffirstnof, *secondno, *midline, *lastno, *lastnof, *lastlastno; char *m_ptr, *m_token; double fnumber, lnumber, delta; int nerror; @@ -4570,7 +4570,7 @@ inp_compat(struct card *card) *str_ptr = ' '; /* get first two numbers to establish extrapolation */ str_ptr = cut_line; - ffirstno = gettok_node(&cut_line); + ffirstnof = ffirstno = gettok_node(&cut_line); if (!ffirstno) { fprintf(stderr, "Error: bad syntax in line %d\n %s\n", card->linenum_orig, card->line); @@ -4588,7 +4588,7 @@ inp_compat(struct card *card) else if (*str_ptr == ')') *str_ptr = ' '; /* scan for last two numbers */ - lastno = gettok_node(&cut_line); + lastnof = lastno = gettok_node(&cut_line); lnumber = INPevaluate(&lastno, &nerror, FALSE); /* check for max-min and take half the difference for delta */ delta = (lnumber-fnumber)/2.; @@ -4610,7 +4610,9 @@ inp_compat(struct card *card) card = insert_new_line(card, ckt_array[i], 0, 0); tfree(firstno); + tfree(ffirstnof); tfree(secondno); + tfree(lastnof); tfree(lastlastno); tfree(expression); tfree(title_tok);