fix a memory leak

ckt->CKTmatrix is now malloced, so has to bee freed as well
This commit is contained in:
Holger Vogt 2020-08-12 16:17:50 +02:00
parent ee0b52b779
commit d5434a2df2
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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; ) {