Browse Source

plug a small memory leak

pre-master-46
Holger Vogt 8 years ago
parent
commit
2e0b8b3e34
  1. 5
      src/frontend/inpcom.c

5
src/frontend/inpcom.c

@ -6951,8 +6951,10 @@ pspice_compat(struct card *oldcard)
card->line = str = inp_remove_ws(card->line); card->line = str = inp_remove_ws(card->line);
str = nexttok(str); /* throw away '.model' */ str = nexttok(str); /* throw away '.model' */
INPgetNetTok(&str, &modname, 0); /* model name */ INPgetNetTok(&str, &modname, 0); /* model name */
if (!ciprefix("vswitch", str))
if (!ciprefix("vswitch", str)) {
tfree(modname);
continue; continue;
}
/* we have to find 4 parameters, identified by '=', separated by spaces */ /* we have to find 4 parameters, identified by '=', separated by spaces */
char *equalptr[4]; char *equalptr[4];
equalptr[0] = strstr(str, "="); equalptr[0] = strstr(str, "=");
@ -6989,6 +6991,7 @@ pspice_compat(struct card *oldcard)
modelsfound = insert_new_model(modelsfound, modname, subcktline->line); modelsfound = insert_new_model(modelsfound, modname, subcktline->line);
else else
modelsfound = insert_new_model(modelsfound, modname, "top"); modelsfound = insert_new_model(modelsfound, modname, "top");
tfree(modname);
} }
} }
/* second scan: find the switch instances s calling a vswitch model and transform them */ /* second scan: find the switch instances s calling a vswitch model and transform them */

Loading…
Cancel
Save