From b0ab1cf8c3a2d864b6ce0675a1235e9293e5730e Mon Sep 17 00:00:00 2001 From: Mike Inouye Date: Fri, 7 Jun 2024 22:51:28 +0000 Subject: [PATCH] Fix memory leak in verific file parsing. Signed-off-by: Mike Inouye --- frontends/verific/verific.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc index b4b0664d3..f7c2cefd2 100644 --- a/frontends/verific/verific.cc +++ b/frontends/verific/verific.cc @@ -3510,6 +3510,12 @@ struct VerificPass : public Pass { verific_error_msg.clear(); log_cmd_error("Reading Verilog/SystemVerilog sources failed.\n"); } + char* fn; + int i = 0; + + FOREACH_ARRAY_ITEM(&file_names, i, fn) { + free(fn); + } set_modules_to_blackbox(map, work, flag_lib); verific_import_pending = true; goto check_error;