From: Michael S. Tsirkin Date: Sun, 8 Feb 2026 22:24:33 +0000 (-0500) Subject: mlmmj-process: clean up queue file on second do_all_the_voodoo_here failure X-Git-Tag: RELEASE_1_8_0~31 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=refs%2Fpull%2F86%2Fhead;p=thirdparty%2Fmlmmj.git mlmmj-process: clean up queue file on second do_all_the_voodoo_here failure The owner-forwarding path re-opens donemailname with O_TRUNC and calls do_all_the_voodoo_here a second time. If this call fails, the truncated queue file is left behind. Add unlink(donemailname) and free(donemailname) to match the cleanup already done at the first call site. Co-Authored-By: Claude Opus 4.6 --- diff --git a/src/mlmmj-process.c b/src/mlmmj-process.c index c04943ee..c7de1de7 100644 --- a/src/mlmmj-process.c +++ b/src/mlmmj-process.c @@ -545,6 +545,11 @@ int main(int argc, char **argv) NULL, &ownerhdrs, NULL, 0) < 0) { log_error(LOG_ARGS, "do_all_the_voodoo_here"); tll_free_and_free(ownerhdrs, free); + close(ownfd); + close(rawmailfd); + close(donemailfd); + unlink(donemailname); + free(donemailname); free_parsed_hdrs(readhdrs, fromemails, originalfromemails, toemails, ccemails, rpemails, dtemails, allheaders); exit(EXIT_FAILURE);