YosysHQ / yosys

Yosys Open SYnthesis Suite
https://yosyshq.net/yosys/
ISC License
3.3k stars 860 forks source link

Fix memory leak in verific file parsing. #4434

Closed mikesinouye closed 3 weeks ago

mikesinouye commented 3 weeks ago

What are the reasons/motivation for this change? Running AddressSanitizer on yosys when using verific uncovered a memory leak in a file_names Array, as the char* copy created by strdup() is not freed.

Explain how this is achieved. Manually iterate over the array and free the memory, similar to other instances in the verific.cc file.

mmicko commented 3 weeks ago

Thanks