Fix memory leaks found by valgrind in the paranoia script.

This commit is contained in:
Giles Atkinson 2022-05-08 15:38:46 +01:00 committed by Holger Vogt
parent dbf4c16bc0
commit daad3fb3c5
2 changed files with 4 additions and 0 deletions

View File

@ -103,6 +103,8 @@ GENmodel *inMod)
break;
case BSIM4v5_MOD_VERSION :
if (mod->BSIM4v5version)
free(mod->BSIM4v5version);
mod->BSIM4v5version = value->sValue;
mod->BSIM4v5versionGiven = TRUE;
break;

View File

@ -87,6 +87,7 @@ VSRCask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, IFvalue *
return (OK);
case VSRC_CURRENT:
if (ckt->CKTcurrentAnalysis & DOING_AC) {
FREE(errMsg);
errMsg = TMALLOC(char, strlen(msg) + 1);
errRtn = "VSRCask";
strcpy(errMsg,msg);
@ -100,6 +101,7 @@ VSRCask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, IFvalue *
return(OK);
case VSRC_POWER:
if (ckt->CKTcurrentAnalysis & DOING_AC) {
FREE(errMsg);
errMsg = TMALLOC(char, strlen(msg) + 1);
errRtn = "VSRCask";
strcpy(errMsg,msg);