From d5434a2df2d4cfb91431ee6e568b4f568f76f77a Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Wed, 12 Aug 2020 16:17:50 +0200 Subject: [PATCH] fix a memory leak ckt->CKTmatrix is now malloced, so has to bee freed as well --- src/maths/ni/nidest.c | 2 +- src/spicelib/analysis/cktdest.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/maths/ni/nidest.c b/src/maths/ni/nidest.c index 0982e60f1..240b58fdf 100644 --- a/src/maths/ni/nidest.c +++ b/src/maths/ni/nidest.c @@ -18,7 +18,7 @@ NIdestroy(CKTcircuit *ckt) { if (ckt->CKTmatrix) SMPdestroy(ckt->CKTmatrix); - ckt->CKTmatrix = NULL; + FREE(ckt->CKTmatrix); if(ckt->CKTrhs) FREE(ckt->CKTrhs); if(ckt->CKTrhsOld) FREE(ckt->CKTrhsOld); if(ckt->CKTrhsSpare) FREE(ckt->CKTrhsSpare); diff --git a/src/spicelib/analysis/cktdest.c b/src/spicelib/analysis/cktdest.c index eb95283e2..24ed208d8 100644 --- a/src/spicelib/analysis/cktdest.c +++ b/src/spicelib/analysis/cktdest.c @@ -68,7 +68,7 @@ CKTdestroy(CKTcircuit *ckt) } if(ckt->CKTmatrix) { SMPdestroy(ckt->CKTmatrix); - ckt->CKTmatrix = NULL; + FREE(ckt->CKTmatrix); } FREE(ckt->CKTbreaks); for(node = ckt->CKTnodes; node; ) {