Browse Source

BSIM 3.3.0 plug memory leak during remcirc

pre-master-46
h_vogt 13 years ago
committed by rlar
parent
commit
d6946705f8
  1. 7
      src/spicelib/devices/bsim3/b3dest.c
  2. 2
      src/spicelib/devices/bsim3/b3set.c

7
src/spicelib/devices/bsim3/b3dest.c

@ -35,7 +35,10 @@ BSIM3destroy(
FREE(pParamOld); FREE(pParamOld);
pParam = NULL; pParam = NULL;
/** end of extra code **/ /** end of extra code **/
if(oldmod) FREE(oldmod);
if(oldmod) {
FREE(oldmod->BSIM3version);
FREE(oldmod);
}
oldmod = mod; oldmod = mod;
prev = NULL; prev = NULL;
for (here = mod->BSIM3instances; here; here = here->BSIM3nextInstance) { for (here = mod->BSIM3instances; here; here = here->BSIM3nextInstance) {
@ -49,6 +52,8 @@ BSIM3destroy(
/* free just once for all models */ /* free just once for all models */
FREE(oldmod->BSIM3InstanceArray); FREE(oldmod->BSIM3InstanceArray);
#endif #endif
/* oldmod->BSIM3modName to be freed in INPtabEnd() */
FREE(oldmod->BSIM3version);
FREE(oldmod); FREE(oldmod);
} }
*model = NULL; *model = NULL;

2
src/spicelib/devices/bsim3/b3set.c

@ -80,7 +80,7 @@ BSIM3instance **InstArray;
printf("Warning: acnqsMod has been set to its default value: 0.\n"); printf("Warning: acnqsMod has been set to its default value: 0.\n");
} }
if (!model->BSIM3versionGiven) if (!model->BSIM3versionGiven)
model->BSIM3version = "3.3.0";
model->BSIM3version = copy("3.3.0");
if (!model->BSIM3toxGiven) if (!model->BSIM3toxGiven)
model->BSIM3tox = 150.0e-10; model->BSIM3tox = 150.0e-10;
model->BSIM3cox = 3.453133e-11 / model->BSIM3tox; model->BSIM3cox = 3.453133e-11 / model->BSIM3tox;

Loading…
Cancel
Save