From 50d787a081ce9a5415a62275ed5601b9ee1270ce Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Mon, 5 Oct 1998 21:03:36 +0000 Subject: [PATCH] File descriptor leak alert. --- handler.c | 7 ++++--- 1 file 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) -- 2.40.0