Skip to content

codeview: fix use after free in cleanup #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions output/codeview.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ static void build_type_table(struct coff_Section *const sect);
static void cv8_cleanup(void)
{
struct cv8_symbol *sym;
struct source_file *file;
struct source_file *file, *filetmp;

struct coff_Section *symbol_sect = coff_sects[cv8_state.symbol_sect];
struct coff_Section *type_sect = coff_sects[cv8_state.type_sect];
Expand All @@ -317,7 +317,7 @@ static void cv8_cleanup(void)
build_symbol_table(symbol_sect);
build_type_table(type_sect);

list_for_each(file, cv8_state.source_files) {
list_for_each_safe(file, filetmp, cv8_state.source_files) {
nasm_free(file->fullname);
saa_free(file->lines);
free(file);
Expand Down