From: Conrad Hughes Date: Thu, 26 Dec 2019 22:29:59 +0000 (-0500) Subject: Fixed file descriptor leak in mhfixmsg when run on multiple input files. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/23816efd3e8e294e8f1c1ce811ac3a1cd15d334e Fixed file descriptor leak in mhfixmsg when run on multiple input files. --- diff --git a/docs/pending-release-notes b/docs/pending-release-notes index 7c2e5221..5a932160 100644 --- a/docs/pending-release-notes +++ b/docs/pending-release-notes @@ -55,3 +55,4 @@ BUG FIXES - Fixed inc(1) and %(me) function escape to not obey Local-Mailbox profile component. - Fixed source charset in mhfixmsg textcharset verbose output. +- Fixed file descriptor leak in mhfixmsg when run on multiple input files. diff --git a/uip/mhfixmsg.c b/uip/mhfixmsg.c index 425801d5..a820c638 100644 --- a/uip/mhfixmsg.c +++ b/uip/mhfixmsg.c @@ -551,6 +551,11 @@ main (int argc, char **argv) (void) m_backup (file); } } + if (outfp) { + /* close fp opened by the m_mktemp2() call in mhfixmsgsbr() */ + fclose (outfp); + outfp = NULL; + } } } else { status = 1;