remove memory leaks

This commit is contained in:
h_vogt 2011-12-30 08:59:03 +00:00
parent 127213bff0
commit 7e96dcc639
4 changed files with 142 additions and 129 deletions

View File

@ -1,3 +1,7 @@
2011-12-29 Holger Vogt
* inppas3.c, cktdest.c: reduce memory leaks
* inpsymt.c: beautify
2011-12-29 Holger Vogt 2011-12-29 Holger Vogt
* b4v6dest.c : improved removal of circuit installation, * b4v6dest.c : improved removal of circuit installation,
bug no. 3229770. Memory leaks are quasi gone for bug no. 3229770. Memory leaks are quasi gone for

View File

@ -53,6 +53,8 @@ CKTdestroy(CKTcircuit *ckt)
FREE(node); FREE(node);
node = nnode; node = nnode;
} }
ckt->CKTnodes = NULL;
ckt->CKTlastNode = NULL;
FREE(ckt->CKTrhs); FREE(ckt->CKTrhs);
FREE(ckt->CKTrhsOld); FREE(ckt->CKTrhsOld);
@ -63,9 +65,13 @@ CKTdestroy(CKTcircuit *ckt)
FREE(ckt->CKTstat->STATdevNum); FREE(ckt->CKTstat->STATdevNum);
FREE(ckt->CKTstat); FREE(ckt->CKTstat);
FREE(ckt->CKThead);
#ifdef XSPICE
FREE(ckt->enh);
FREE(ckt->evt);
#endif
ckt->CKTnodes = NULL;
ckt->CKTlastNode = NULL;
FREE(ckt); FREE(ckt);
return(OK); return(OK);
} }

View File

@ -103,7 +103,10 @@ INPpas3(CKTcircuit *ckt, card *data, INPtables *tab, TSKtask *task,
/* loop until we run out of data */ /* loop until we run out of data */
INPgetTok(&line,&name,1); INPgetTok(&line,&name,1);
/* check to see if in the form V(xxx) and grab the xxx */ /* check to see if in the form V(xxx) and grab the xxx */
if( *name == 0) break; /* end of line */ if( *name == 0) {
FREE(name);
break; /* end of line */
}
if( (*name == 'V' || *name == 'v') && !name[1] ) { if( (*name == 'V' || *name == 'v') && !name[1] ) {
/* looks like V - must be V(xx) - get xx now*/ /* looks like V - must be V(xx) - get xx now*/
INPgetTok(&line,&name,1); INPgetTok(&line,&name,1);