b4v5dest.c, b4v6dest.c, remove memory leak
This commit is contained in:
parent
f997203c6d
commit
f22e8dd970
|
|
@ -35,7 +35,10 @@ BSIM4v5destroy(
|
|||
FREE(pParamOld);
|
||||
pParam = NULL;
|
||||
/** end of extra code **/
|
||||
if(oldmod) FREE(oldmod);
|
||||
if (oldmod) {
|
||||
FREE(oldmod->BSIM4v5version);
|
||||
FREE(oldmod);
|
||||
}
|
||||
oldmod = mod;
|
||||
prev = NULL;
|
||||
for (here = mod->BSIM4v5instances; here; here = here->BSIM4v5nextInstance) {
|
||||
|
|
@ -49,6 +52,7 @@ BSIM4v5destroy(
|
|||
/* free just once for all models */
|
||||
FREE(oldmod->BSIM4v5InstanceArray);
|
||||
#endif
|
||||
FREE(oldmod->BSIM4v5version);
|
||||
FREE(oldmod);
|
||||
}
|
||||
*model = NULL;
|
||||
|
|
|
|||
|
|
@ -38,8 +38,10 @@ BSIM4v6destroy(
|
|||
pParam = NULL;
|
||||
/** end of extra code **/
|
||||
|
||||
if(oldmod)
|
||||
FREE(oldmod);
|
||||
if (oldmod) {
|
||||
FREE(oldmod->BSIM4v6version);
|
||||
FREE(oldmod);
|
||||
}
|
||||
oldmod = mod;
|
||||
prev = NULL;
|
||||
for (here = mod->BSIM4v6instances; here; here = here->BSIM4v6nextInstance) {
|
||||
|
|
@ -53,6 +55,7 @@ BSIM4v6destroy(
|
|||
/* free just once for all models */
|
||||
FREE(oldmod->BSIM4v6InstanceArray);
|
||||
#endif
|
||||
FREE(oldmod->BSIM4v6version);
|
||||
FREE(oldmod);
|
||||
}
|
||||
*model = NULL;
|
||||
|
|
|
|||
Loading…
Reference in New Issue