From 3ae3e347327d9c4715712224f9342fbae3a98de1 Mon Sep 17 00:00:00 2001 From: Cary R Date: Tue, 19 May 2009 19:37:18 -0700 Subject: [PATCH] Cleanup if an invalid option is given. Cleanup the temporary files and memory if iverilog is given an invalid option. --- driver/main.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/driver/main.c b/driver/main.c index 266e88df4..17d62a2fb 100644 --- a/driver/main.c +++ b/driver/main.c @@ -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; } }