]> granicus.if.org Git - mutt/commitdiff
mutt_message_to_7bit(): Only close file pointer if we opened it
authorErik Hovland <erik@hovland.org>
Mon, 6 Apr 2009 17:10:35 +0000 (19:10 +0200)
committerErik Hovland <erik@hovland.org>
Mon, 6 Apr 2009 17:10:35 +0000 (19:10 +0200)
The pointer is to be managed outside the function and provided.
Only close it we opened it ourself using fopen().

ChangeLog
sendlib.c

index 60d54e684c297d87fd12bd6ccda5ddb048790102..2cd9f82fb531ab291d0bcbe9df80e4a1a8cf6877 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-04-06 19:07 +0200  Erik Hovland  <erik@hovland.org>  (b5cbd0dab863)
+
+       * sendlib.c: Plug memory leaks in sendlib.c
+
 2009-04-05 13:41 +0200  Rocco Rutte  <pdmef@gmx.net>  (5d393e716c51)
 
        * ChangeLog, init.h, sendlib.c: Backed out changeset 23c7b469ff20
index e7f014a8105b0d9a6e9173fa832ae50e7acdf264..64d21b76fd92c407b3c150d0b4276cc2648bd460 100644 (file)
--- 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);