]> granicus.if.org Git - mutt/commitdiff
Do not attempt to close invalid descriptors. Closes #3075
authorAlexey I. Froloff <raorn@altlinux.org>
Thu, 12 Jun 2008 05:45:14 +0000 (22:45 -0700)
committerAlexey I. Froloff <raorn@altlinux.org>
Thu, 12 Jun 2008 05:45:14 +0000 (22:45 -0700)
attach.c

index 8c3edf2e5df894e19dab463109fe82eb7d0ecce4..203a1b165abd59c732328a74116bda570febd151 100644 (file)
--- 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
     {