Cleanup if an invalid option is given.

Cleanup the temporary files and memory if iverilog is given
an invalid option.
This commit is contained in:
Cary R 2009-05-19 19:37:18 -07:00 committed by Stephen Williams
parent 372efd8c30
commit 3ae3e34732
1 changed files with 14 additions and 0 deletions

View File

@ -866,6 +866,20 @@ int main(int argc, char **argv)
break;
case '?':
default:
fclose(source_file);
remove(source_path);
free(source_path);
fclose(defines_file);
remove(defines_path);
free(defines_path);
fclose(iconfig_file);
remove(iconfig_path);
free(iconfig_path);
remove(compiled_defines_path);
free(compiled_defines_path);
while( (command_filename = get_cmd_file()) ) {
free(command_filename);
}
return 1;
}
}