From 55b24d5300049d2cbf13a7c9428815cf14c9126d Mon Sep 17 00:00:00 2001 From: Erik Hovland Date: Mon, 6 Apr 2009 19:10:35 +0200 Subject: [PATCH] mutt_message_to_7bit(): Only close file pointer if we opened it The pointer is to be managed outside the function and provided. Only close it we opened it ourself using fopen(). --- ChangeLog | 4 ++++ sendlib.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 60d54e68..2cd9f82f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-04-06 19:07 +0200 Erik Hovland (b5cbd0dab863) + + * sendlib.c: Plug memory leaks in sendlib.c + 2009-04-05 13:41 +0200 Rocco Rutte (5d393e716c51) * ChangeLog, init.h, sendlib.c: Backed out changeset 23c7b469ff20 diff --git a/sendlib.c b/sendlib.c index e7f014a8..64d21b76 100644 --- a/sendlib.c +++ b/sendlib.c @@ -1070,7 +1070,7 @@ void mutt_message_to_7bit (BODY *a, FILE *fp) cleanup: FREE (&line); - if (fpin && !fp) + if (fpin && fpin != fp) safe_fclose (&fpin); if (fpout) safe_fclose (&fpout); -- 2.40.0