From 9c02c7d7a448d6a52791d80f8863345ea3495149 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 6dc1496dd..66e451397 100644 --- a/driver/main.c +++ b/driver/main.c @@ -870,6 +870,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; } }