From 419da12d36705acf32382cdf52e0fd8a761b817c Mon Sep 17 00:00:00 2001 From: h_vogt Date: Thu, 5 Sep 2013 14:57:15 +0200 Subject: [PATCH] inp.c: inp_parse_temper(), plug memory leak --- src/frontend/inp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/frontend/inp.c b/src/frontend/inp.c index be09f35c5..173d6e8c4 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -1352,7 +1352,7 @@ static int inp_parse_temper(struct line *card) { int error = 0; - char *end_tstr, *beg_tstr, *beg_pstr, *str_ptr, *devmodname, *paramname, *expression; + char *end_tstr, *beg_tstr, *beg_pstr, *str_ptr, *devmodname, *paramname; /* skip title line */ card = card->li_next; @@ -1402,8 +1402,8 @@ inp_parse_temper(struct line *card) while(!isspace(*end_tstr)) end_tstr--; } - expression = copy_substring(beg_tstr + 1, end_tstr); - modtlistnew->expression = copy(expression); + /* copy the expression */ + modtlistnew->expression = copy_substring(beg_tstr + 1, end_tstr); /* now remove this parameter entry by overwriting with ' ' ngspice then will use the default parameter to set up the circuit */ for (str_ptr = beg_pstr; str_ptr < end_tstr; str_ptr++) @@ -1457,8 +1457,8 @@ inp_parse_temper(struct line *card) while(!isspace(*end_tstr)) end_tstr--; } - expression = copy_substring(beg_tstr + 1, end_tstr); - devtlistnew->expression = copy(expression); + /* copy the expression */ + devtlistnew->expression = copy_substring(beg_tstr + 1, end_tstr); /* now remove this parameter entry by overwriting with ' ' ngspice then will use the default parameter to set up the circuit */ for (str_ptr = beg_pstr; str_ptr < end_tstr; str_ptr++)