diff --git a/src/modules/c/shell/commmands.c b/src/modules/c/shell/commmands.c index 239c181..7db5a17 100644 --- a/src/modules/c/shell/commmands.c +++ b/src/modules/c/shell/commmands.c @@ -214,6 +214,7 @@ int shell_command_cd(int argc, char* argv[], const char* args) printf("Wechseln in das Verzeichnis '%s' nicht moeglich\n", path); } else { chdir(path); + closedir(dir); } free(path); } diff --git a/src/modules/c/shell/completion.c b/src/modules/c/shell/completion.c index f452b60..7e86234 100644 --- a/src/modules/c/shell/completion.c +++ b/src/modules/c/shell/completion.c @@ -251,6 +251,7 @@ static char** shell_file_matches(const char* word) if (list_size(matches_list) == 0) { list_destroy(matches_list); + directory_close(dir); goto out; }