From 6d0d8b713d9b8519f8ae882217a3d682d9d7ed24 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Sun, 8 Feb 2026 17:24:33 -0500 Subject: [PATCH] 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 --- src/mlmmj-process.c | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.47.3