]> granicus.if.org Git - mutt/commitdiff
File descriptor leak alert.
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 5 Oct 1998 21:03:36 +0000 (21:03 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 5 Oct 1998 21:03:36 +0000 (21:03 +0000)
handler.c

index 8e045a4712e790c479fd003ca554e5f97fe88852..aeb381f73c8c016cdf7f44cdac88d0f1945a7d1d 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -1098,8 +1098,7 @@ void autoview_handler (BODY *a, STATE *s)
       fflush(fpin);
       rewind(fpin);
       thepid = mutt_create_filter_fd (command, NULL, &fpout, &fperr,
-                                     dup(fileno(fpin)), -1, -1);
-      fclose(fpin);
+                                     fileno(fpin), -1, -1);
     }
 
     if (s->prefix)
@@ -1151,7 +1150,9 @@ void autoview_handler (BODY *a, STATE *s)
     fclose (fpout);
     fclose (fperr);
     mutt_wait_filter (thepid);
-    if(!piped)
+    if(piped)
+      fclose(fpin);
+    else
       mutt_unlink (tempfile);
 
     if (s->flags & M_DISPLAY)