Skip to content
Snippets Groups Projects
Commit e5cc7703 authored by Yorhel's avatar Yorhel
Browse files

Properly free return value of opendir() on calculation interrupt

When interrupinting the calculation process by pressing 'q' while
it's looping through a directory, or when a directory could be openend
but not chdir()'ed into, closedir() wasn't called.
parent 21f2e627
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ git - ? ...@@ -3,6 +3,7 @@ git - ?
- Properly select the next item after deletion - Properly select the next item after deletion
- Removed reliance of dirfd() - Removed reliance of dirfd()
- Fixed non-void return in void delete_process() - Fixed non-void return in void delete_process()
- Fixed several tiny memory leaks
1.5 - 2009-05-02 1.5 - 2009-05-02
- Fixed incorrect apparent size on directory refresh - Fixed incorrect apparent size on directory refresh
......
...@@ -177,6 +177,8 @@ int calc_dir(struct dir *dest, char *name) { ...@@ -177,6 +177,8 @@ int calc_dir(struct dir *dest, char *name) {
while((t = t->parent) != NULL) while((t = t->parent) != NULL)
t->flags |= FF_SERR; t->flags |= FF_SERR;
calc_leavepath(); calc_leavepath();
if(dir != NULL)
closedir(dir);
return 0; return 0;
} }
...@@ -187,6 +189,7 @@ int calc_dir(struct dir *dest, char *name) { ...@@ -187,6 +189,7 @@ int calc_dir(struct dir *dest, char *name) {
dest->flags |= FF_ERR; dest->flags |= FF_ERR;
if(input_handle(1)) { if(input_handle(1)) {
calc_leavepath(); calc_leavepath();
closedir(dir);
return 1; return 1;
} }
calc_leavepath(); calc_leavepath();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment