Fix some memory leaks (Patch provided by Brian Taylor)

This commit is contained in:
Holger Vogt 2023-07-21 00:13:49 +02:00
parent 4864f0a118
commit c11613d1f7
2 changed files with 12 additions and 0 deletions

View File

@ -39,6 +39,9 @@ TWOdestroy(TWOdevice *pDevice)
#else
SMPdestroy (pDevice->matrix) ;
#endif
if (pDevice->matrix) {
FREE(pDevice->matrix);
}
break;
case SLV_EQUIL:
@ -53,6 +56,9 @@ TWOdestroy(TWOdevice *pDevice)
#else
SMPdestroy (pDevice->matrix) ;
#endif
if (pDevice->matrix) {
FREE(pDevice->matrix);
}
break;
case SLV_NONE:

View File

@ -491,6 +491,9 @@ int TWOequilSolve(TWOdevice *pDevice)
#else
SMPdestroy (pDevice->matrix) ;
#endif
if (pDevice->matrix) {
FREE(pDevice->matrix);
}
/* FALLTHROUGH */
case SLV_NONE: {
@ -651,6 +654,9 @@ TWObiasSolve(TWOdevice *pDevice, int iterationLimit, BOOLEAN tranAnalysis,
#else
SMPdestroy (pDevice->matrix) ;
#endif
if (pDevice->matrix) {
FREE(pDevice->matrix);
}
/* FALLTHROUGH */
case SLV_NONE: