X-Git-Url: http://sjero.net/git/?a=blobdiff_plain;f=src%2Finit.c;h=8624f128e17f987ef5a22e65e37f33532c733418;hb=78706dc5ea8eeb5d5a5eacda806d549a5c81ee89;hp=b48a57c13aa7eb4ff7a60b792237947577b2607e;hpb=381457408ad4d78411552a28e7476a5c1f67831e;p=wget diff --git a/src/init.c b/src/init.c index b48a57c1..8624f128 100644 --- a/src/init.c +++ b/src/init.c @@ -1284,8 +1284,13 @@ cleanup (void) { /* Free external resources, close files, etc. */ - if (opt.dfp) - fclose (opt.dfp); + { + extern FILE *output_stream; + if (output_stream) + fclose (output_stream); + /* No need to check for error because Wget flushes its output (and + checks for errors) after any data arrives. */ + } /* We're exiting anyway so there's no real need to call free() hundreds of times. Skipping the frees will make Wget exit