diff --git a/src/autocomplete.c b/src/autocomplete.c index 5b6af44..109d925 100644 --- a/src/autocomplete.c +++ b/src/autocomplete.c @@ -284,6 +284,8 @@ int dir_match(ToxWindow *self, Tox *m, const wchar_t *line, const wchar_t *cmd) } } + closedir(dp); + if (dircount == 0) return -1; diff --git a/src/chat.c b/src/chat.c index e44546d..ea2a8da 100644 --- a/src/chat.c +++ b/src/chat.c @@ -325,6 +325,7 @@ static void chat_onFileSendRequest(ToxWindow *self, Tox *m, int32_t num, uint8_t int count = 1; while ((filecheck = fopen(filename, "r"))) { + fclose(filecheck); filename[len] = '\0'; char d[9]; sprintf(d, "(%d)", count++);