From: Alexey I. Froloff Date: Thu, 12 Jun 2008 05:45:14 +0000 (-0700) Subject: Do not attempt to close invalid descriptors. Closes #3075 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ffbb48902c2c298eb1435e915d570ce2f3143fce;p=mutt Do not attempt to close invalid descriptors. Closes #3075 --- diff --git a/attach.c b/attach.c index 8c3edf2e..203a1b16 100644 --- a/attach.c +++ b/attach.c @@ -561,10 +561,11 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, if ((mutt_wait_filter (thepid) || (entry->needsterminal && option (OPTWAITKEY))) && !use_pager) mutt_any_key_to_continue (NULL); - - close(tempfd); - close(pagerfd); - + + if (tempfd != -1) + close (tempfd); + if (pagerfd != -1) + close (pagerfd); } else {