BSIM 3.2.4 plug memory leak during remcirc

This commit is contained in:
h_vogt 2013-08-24 18:07:04 +02:00 committed by rlar
parent d6946705f8
commit d38d907fbc
2 changed files with 9 additions and 3 deletions

View File

@ -35,7 +35,10 @@ BSIM3v32destroy (GENmodel **inModel)
FREE(pParamOld);
pParam = NULL;
/** end of extra code **/
if(oldmod) FREE(oldmod);
if(oldmod) {
FREE(oldmod->BSIM3v32version);
FREE(oldmod);
}
oldmod = mod;
prev = NULL;
for (here = mod->BSIM3v32instances; here; here = here->BSIM3v32nextInstance) {
@ -44,7 +47,10 @@ BSIM3v32destroy (GENmodel **inModel)
}
if(prev) FREE(prev);
}
if(oldmod) FREE(oldmod);
if(oldmod) {
FREE(oldmod->BSIM3v32version);
FREE(oldmod);
}
*model = NULL;
return;
}

View File

@ -69,7 +69,7 @@ IFuid tmpName;
* we always choose the most recent.
*/
if (!model->BSIM3v32versionGiven)
model->BSIM3v32version = "3.2.4";
model->BSIM3v32version = copy("3.2.4");
/* I have added below the code that translate model string
* into an integer. This trick is meant to speed up the