]> git.wh0rd.org Git - nano.git/commitdiff
- nano.c:do_int_speller() - Fix FD leaks which occur outside of errors (David Benbennick)
authorChris Allegretta <chrisa@asty.org>
Thu, 16 Jan 2003 03:11:23 +0000 (03:11 +0000)
committerChris Allegretta <chrisa@asty.org>
Thu, 16 Jan 2003 03:11:23 +0000 (03:11 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1363 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
nano.c

index 455648076345822bf13c55744bad295f73cf458f..36b387fe58cea61932b3b5d6ee17fae723ffffed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -157,6 +157,7 @@ Changes
          either be improved or removed.  I chose improved].
        - Change all child error checks to use one goto (gasp!) called 
          close_pipes_and_exit, so we don't leak FDs.
+       - Fix FD leaks which occur outside of errors (David Benbennick).
   do_int_speller(), do_alt_speller()
        - Programs now return char *, NULL for successful completion,
          otherwise the error string to display.  This allows us to give
diff --git a/nano.c b/nano.c
index 35e7af4f5f40da31ddb9369fbf4bddd6d5b924c3..e20378f2875101fd8d6f51ae5fb6ce0fab5dfa86 100644 (file)
--- a/nano.c
+++ b/nano.c
@@ -1766,6 +1766,7 @@ char *do_int_speller(char *tempfile_name)
        exit(1);
     }
 
+    close(spell_fd[0]);
     close(sort_fd[1]);
 
     /* A new process to run uniq in */
@@ -1791,6 +1792,7 @@ char *do_int_speller(char *tempfile_name)
        exit(1);
     }
 
+    close(sort_fd[0]);
     close(uniq_fd[1]);
 
     /* Child process was not forked successfully */