lto.c (lto_wpa_write_files, [...]): Free lto_file struct after closing the file.

2012-10-08  Tobias Burnus  <burnus@net-b.de>

        * lto.c (lto_wpa_write_files, read_cgraph_and_symbols):
        Free lto_file struct after closing the file.

From-SVN: r192216
This commit is contained in:
Tobias Burnus 2012-10-08 18:51:10 +02:00 committed by Tobias Burnus
parent 16fdb75f78
commit da3202a857
2 changed files with 9 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2012-10-08 Tobias Burnus <burnus@net-b.de>
* lto.c (lto_wpa_write_files, read_cgraph_and_symbols):
Free lto_file struct after closing the file.
2012-10-08 Jan Hubicka <jh@suse.cz> 2012-10-08 Jan Hubicka <jh@suse.cz>
* lto/lto.c (remember_with_vars): Also fixup INTEGER_CST. * lto/lto.c (remember_with_vars): Also fixup INTEGER_CST.

View file

@ -2674,6 +2674,7 @@ lto_wpa_write_files (void)
lto_set_current_out_file (NULL); lto_set_current_out_file (NULL);
lto_obj_file_close (file); lto_obj_file_close (file);
free (file);
part->encoder = NULL; part->encoder = NULL;
len = strlen (temp_filename); len = strlen (temp_filename);
@ -2690,6 +2691,7 @@ lto_wpa_write_files (void)
fatal_error ("closing LTRANS output list %s: %m", ltrans_output_list); fatal_error ("closing LTRANS output list %s: %m", ltrans_output_list);
free_ltrans_partitions(); free_ltrans_partitions();
free (temp_filename);
timevar_pop (TV_WHOPR_WPA_IO); timevar_pop (TV_WHOPR_WPA_IO);
} }
@ -2952,6 +2954,7 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
if (!file_data) if (!file_data)
{ {
lto_obj_file_close (current_lto_file); lto_obj_file_close (current_lto_file);
free (current_lto_file);
current_lto_file = NULL; current_lto_file = NULL;
break; break;
} }
@ -2959,6 +2962,7 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
decl_data[last_file_ix++] = file_data; decl_data[last_file_ix++] = file_data;
lto_obj_file_close (current_lto_file); lto_obj_file_close (current_lto_file);
free (current_lto_file);
current_lto_file = NULL; current_lto_file = NULL;
ggc_collect (); ggc_collect ();
} }