diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2016-09-24 17:11:19 +0100 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2016-09-24 17:11:19 +0100 |
commit | c0741086da04768bb4c9e896b311ad3c1166b631 (patch) | |
tree | 063227c143116f4704ff2485ccf276ed2db65d2e /src | |
parent | 4ae758e46af02b9da0f28fdbfad83eea5e0dffbe (diff) |
Delivery: fix memory leak
Diffstat (limited to 'src')
-rw-r--r-- | src/src/deliver.c | 6 |
1 files changed, 5 insertions, 1 deletions
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); } |