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.
httpmirror()(src/htscore.c) ends with a teardown at :2292 that runswarc_close_opt,hts_changes_close_optandhts_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_optthere, 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 onegotolabel would fix the set in one place. The bailouts return -1 where the tail returns 1, and the rollback setsopt->state.exit_xhfirst, so the label has to keep those apart rather than flatten them.