Browse Source

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

pre-master-46
rlar 9 years ago
parent
commit
50c0424225
  1. 5
      src/spicelib/parser/inp2m.c
  2. 2
      src/spicelib/parser/inp2q.c

5
src/spicelib/parser/inp2m.c

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

2
src/spicelib/parser/inp2q.c

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

Loading…
Cancel
Save