Browse Source

Fix some memory leaks (Patch provided by Brian Taylor)

pre-master-46
Holger Vogt 3 years ago
parent
commit
c11613d1f7
  1. 6
      src/ciderlib/twod/twodest.c
  2. 6
      src/ciderlib/twod/twosolve.c

6
src/ciderlib/twod/twodest.c

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

6
src/ciderlib/twod/twosolve.c

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

Loading…
Cancel
Save