* src/init.c (cleanup): Never call cleanup() twice

This commit is contained in:
Tim Rühsen 2018-04-15 22:05:34 +02:00
parent e0860dd1ff
commit d7e3acb2cc

View File

@ -1890,8 +1890,12 @@ extern struct ptimer *timer;
void
cleanup (void)
{
static int cleaned_up;
/* Free external resources, close files, etc. */
if (cleaned_up++)
return; /* cleanup() must not be called twice */
/* Close WARC file. */
if (opt.warc_filename != 0)
warc_close ();