Skip to content

Early returns in httpmirror skip the WARC, changes and sitemap teardown #1061

Description

@xroche

httpmirror() (src/htscore.c) ends with a teardown at :2292 that runs warc_close_opt, hts_changes_close_opt and hts_sitemap_free. Four early returns never reach it: the three crawl-loop bailouts at :1281, :1619 and :1808 (XH_uninit; return -1;), and the no-data rollback at :2089.

#1046 patched the rollback branch alone, and only for the archive: it calls warc_abort_opt there, so the WARC writer is closed and its temporaries dropped, but the changes file and the sitemap list still leak on that path and all three are lost on the loop bailouts. Routing every exit through one goto label would fix the set in one place. The bailouts return -1 where the tail returns 1, and the rollback sets opt->state.exit_xh first, so the label has to keep those apart rather than flatten them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions