}
}
+ FILE* toClose= 0;
+
// If we're not reading the file from stdin.
if (infile != NULL)
{
if (bm->UserFlags.smtlib1_parser_flag)
{
smtin = fopen(infile,"r");
+ toClose = smtin;
if(smtin == NULL)
{
fprintf(stderr,"%s: Error: cannot open %s\n",prog,infile);
if (bm->UserFlags.smtlib2_parser_flag)
{
smt2in = fopen(infile,"r");
+ toClose = smt2in;
if(smt2in == NULL)
{
fprintf(stderr,"%s: Error: cannot open %s\n",prog,infile);
else
{
cvcin = fopen(infile,"r");
+ toClose = cvcin;
if(cvcin == NULL)
{
fprintf(stderr,"%s: Error: cannot open %s\n",prog,infile);
cvclex_destroy();
}
parserInterface = NULL;
+ if (toClose != NULL)
+ fclose(toClose);
}
bm->GetRunTimes()->stop(RunTimes::Parsing);