plug a memory leak, delete 'element', if tmalloced before

This commit is contained in:
Holger Vogt 2018-11-11 00:46:16 +01:00
parent c98b472366
commit 34f0e98080
1 changed files with 3 additions and 0 deletions

View File

@ -455,6 +455,9 @@ MIFunsetup(GENmodel *inModel,CKTcircuit *ckt)
for (model = (MIFmodel *)inModel; model != NULL;
model = MIFnextModel(model)) {
for (i = 0; i < model->num_param; i++)
if (model->param[i]->is_null)
tfree(model->param[i]->element);
for(here = MIFinstances(model); here != NULL; here = MIFnextInstance(here)) {
/* Skip these expensive allocations if the instance is not analog */
if(! here->analog)