diff --git a/src/ciderlib/twod/twodest.c b/src/ciderlib/twod/twodest.c index 537adc51d..71643ffd1 100644 --- a/src/ciderlib/twod/twodest.c +++ b/src/ciderlib/twod/twodest.c @@ -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: diff --git a/src/ciderlib/twod/twosolve.c b/src/ciderlib/twod/twosolve.c index fa09d4db6..8a509ef17 100644 --- a/src/ciderlib/twod/twosolve.c +++ b/src/ciderlib/twod/twosolve.c @@ -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: