diff --git a/crashlog/crashutils.c b/crashlog/crashutils.c index b66c752..df42d5e 100755 --- a/crashlog/crashutils.c +++ b/crashlog/crashutils.c @@ -183,6 +183,7 @@ static int find_system_last_kmsg(char source[], int source_length) { } } } + closedir(dir); return file_exist; } diff --git a/crashlog/fsutils.h b/crashlog/fsutils.h index 60795e3..51e75a9 100644 --- a/crashlog/fsutils.h +++ b/crashlog/fsutils.h @@ -89,7 +89,7 @@ static inline int dir_exists(const char *dirpath) { dir = opendir(dirpath); if (dir != NULL) { - closedir(dirpath); + closedir(dir); return 1; } return 0;