mirror of
https://github.com/mirror/wget.git
synced 2025-01-20 09:10:14 +08:00
* src/init.c (cleanup): Never call cleanup() twice
This commit is contained in:
parent
e0860dd1ff
commit
d7e3acb2cc
@ -1890,8 +1890,12 @@ extern struct ptimer *timer;
|
|||||||
void
|
void
|
||||||
cleanup (void)
|
cleanup (void)
|
||||||
{
|
{
|
||||||
|
static int cleaned_up;
|
||||||
/* Free external resources, close files, etc. */
|
/* Free external resources, close files, etc. */
|
||||||
|
|
||||||
|
if (cleaned_up++)
|
||||||
|
return; /* cleanup() must not be called twice */
|
||||||
|
|
||||||
/* Close WARC file. */
|
/* Close WARC file. */
|
||||||
if (opt.warc_filename != 0)
|
if (opt.warc_filename != 0)
|
||||||
warc_close ();
|
warc_close ();
|
||||||
|
Loading…
Reference in New Issue
Block a user