X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Finit.c;h=4188ca16c1b66795f896baa771a6caa836af2437;hp=d5f9a4f09bdb9c0d447a59b0333df96a59555915;hb=ae0598df9bc459652c167fa9826a72b10b775a7a;hpb=6b5c0c742d251dd299ad46b43ea6bb576b7b8997 diff --git a/src/init.c b/src/init.c index d5f9a4f0..4188ca16 100644 --- a/src/init.c +++ b/src/init.c @@ -30,6 +30,7 @@ shall include the source code for the parts of OpenSSL used as well as that of the covered work. */ #include "wget.h" +#include "exits.h" #include #include @@ -1675,8 +1676,16 @@ cleanup (void) { /* Free external resources, close files, etc. */ + /* Close WARC file. */ + if (opt.warc_filename != 0) + warc_close (); + + log_close (); + if (output_stream) - fclose (output_stream); + if (fclose (output_stream) == EOF) + inform_exit_status (CLOSEFAILED); + /* No need to check for error because Wget flushes its output (and checks for errors) after any data arrives. */ @@ -1696,6 +1705,9 @@ cleanup (void) host_cleanup (); log_cleanup (); + for (i = 0; i < nurl; i++) + xfree (url[i]); + { extern acc_t *netrc_list; free_netrc (netrc_list);