projects
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4ae758e
)
Delivery: fix memory leak
author
Jeremy Harris
<jgh146exb@wizmail.org>
Sat, 24 Sep 2016 16:11:19 +0000
(17:11 +0100)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Sat, 24 Sep 2016 16:11:19 +0000
(17:11 +0100)
src/src/deliver.c
patch
|
blob
|
blame
|
history
diff --git
a/src/src/deliver.c
b/src/src/deliver.c
index 357c60702c05e37b72ce7536f88e365bef17799c..eb6c705155ffc6a1bc264cb0c067064c8735095c 100644
(file)
--- 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);
}