From: Jeremy Harris Date: Sat, 24 Sep 2016 16:11:19 +0000 (+0100) Subject: Delivery: fix memory leak X-Git-Tag: exim-4_88_RC2~18 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c0741086da04768bb4c9e896b311ad3c1166b631;p=exim.git Delivery: fix memory leak --- diff --git a/src/src/deliver.c b/src/src/deliver.c index 357c60702..eb6c70515 100644 --- a/src/src/deliver.c +++ b/src/src/deliver.c @@ -5555,7 +5555,11 @@ Otherwise it might be needed again. */ "journal file\n", big_buffer); } rewind(jread); - journal_fd = fileno(jread); + if ((journal_fd = dup(fileno(jread))) < 0) + journal_fd = fileno(jread); + else + (void) fclose(jread); /* Try to not leak the FILE resource */ + /* Panic-dies on error */ (void)spool_write_header(message_id, SW_DELIVERING, NULL); }