use errMsg under ngdebug condition and prevent memory leak

This commit is contained in:
dwarning 2020-02-23 19:30:23 +01:00
parent 9f8509d53c
commit 646ac2dbcb
1 changed files with 5 additions and 0 deletions

View File

@ -29,7 +29,12 @@ CKTask(CKTcircuit *ckt, GENinstance *instance, int which, IFvalue *value, IFvalu
}
if (error && ft_stricterror) {
fprintf(stderr, "\nError: %s\n", errMsg);
FREE(errMsg);
controlled_exit(EXIT_BAD);
}
if (error && ft_ngdebug) {
printf("\nWarning: %s\n", errMsg);
}
FREE(errMsg);
return(error);
}