From: Thomas Roessler Date: Mon, 5 Oct 1998 21:03:36 +0000 (+0000) Subject: File descriptor leak alert. X-Git-Tag: mutt-0-94-13-rel~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=50d787a081ce9a5415a62275ed5601b9ee1270ce;p=mutt File descriptor leak alert. --- 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)