summaryrefslogtreecommitdiffstats
path: root/handler.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-10-05 21:03:36 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-10-05 21:03:36 +0000
commit50d787a081ce9a5415a62275ed5601b9ee1270ce (patch)
tree20de1f6f5f7ac47740ab929c23b34f2a721eec79 /handler.c
parent19fbdcf0bff0e1a81debe644c8a23576222eb9d1 (diff)
File descriptor leak alert.
Diffstat (limited to 'handler.c')
-rw-r--r--handler.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/handler.c b/handler.c
index 8e045a47..aeb381f7 100644
--- 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)