nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] File descriptor leak in mhfixmsg?


From: David Levine
Subject: Re: [Nmh-workers] File descriptor leak in mhfixmsg?
Date: Thu, 26 Dec 2019 17:35:33 -0500

Conrad writes:

> It *looks* to me as if the declaration in mhfixmsgsbr() that outfp will
> be closed by its caller is not strictly true: if I understand correctly,
> a new file is opened every time the cts/ctp loop on line 540 iterates,
> where the only *close* is a singular one on line 564.  Adding a line 554
> along the lines of
>
>   if (outfp) { fclose (outfp); outfp = NULL; }
>
> .. appears to solve things for me without breaking any tests;

Fix committed, thank you!

> Seems
> *possible* there was a no-longer-relevant design decision to relinquish
> control over outfp, and it could perhaps now be closed in mhfixmsgsbr()?

The idea was to allow mhfixmsgsbr() to be callable by other programs.  It
in fact isn't, but that's consistent with other MH usage of having the
main program call a sbr.

David



reply via email to

[Prev in Thread] Current Thread [Next in Thread]