inp2q.c, inp2m.c, plug a memory leak

This commit is contained in:
rlar 2017-03-18 19:51:45 +01:00
parent 43f24d6f22
commit 50c0424225
2 changed files with 3 additions and 4 deletions

View File

@ -93,12 +93,11 @@ INP2M(CKTcircuit *ckt, INPtables *tab, card *current)
save = line; /* saj - save the posn for later if
the default mosfet model is used */
err_msg = INPgetMod(ckt, nname[i], &thismodel, tab);
tfree(err_msg);
txfree(INPgetMod(ckt, nname[i], &thismodel, tab));
/* check if using model binning -- pass in line since need 'l' and 'w' */
if (!thismodel && i < 5)
INPgetModBin(ckt, nname[i], &thismodel, tab, line);
txfree(INPgetModBin(ckt, nname[i], &thismodel, tab, line));
if (thismodel)
break;

View File

@ -68,7 +68,7 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode)
INPgetTok(&line, &token, 1);
if (i >= 3 && INPlookMod(token)) {
INPinsert(&token, tab);
INPgetMod(ckt, token, &thismodel, tab);
txfree(INPgetMod(ckt, token, &thismodel, tab));
if (!thismodel) {
LITERR ("Unable to find definition of given model");
return;