* dir.c (do_load_dir): Fix leaking of file descriptors - always

call mc_closedir() before return.
This commit is contained in:
Pavel Roskin 2002-08-15 02:02:49 +00:00
parent 66c5184faa
commit 786c75b683
2 changed files with 5 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2002-08-14 Pavel Roskin <proski@gnu.org>
* dir.c (do_load_dir): Fix leaking of file descriptors - always
call mc_closedir() before return.
* main.c (do_execute) [!HAVE_SUBSHELL_SUPPORT]: Compile fix.
* view.c (display): Use only declared color pairs to fix hex

View File

@ -483,6 +483,7 @@ do_load_dir (dir_list *list, sortfn *sort, int reverse, int case_sensitive, char
continue;
if (status == -1){
tree_store_end_check ();
mc_closedir (dirp);
return next_free;
}
list->list [next_free].fnamelen = NLENGTH (dp);
@ -505,6 +506,7 @@ do_load_dir (dir_list *list, sortfn *sort, int reverse, int case_sensitive, char
do_sort (list, sort, next_free-1, reverse, case_sensitive);
} else {
tree_store_end_check ();
mc_closedir (dirp);
return set_zero_dir (list);
}