From ec23cedc3ae59179ffc4be9cc3325f070cd40b51 Mon Sep 17 00:00:00 2001 From: Andrey Alekseenko Date: Wed, 18 Mar 2015 19:28:04 +0300 Subject: [PATCH] Fixing couple leaking file descriptors --- src/autocomplete.c | 2 ++ src/chat.c | 1 + 2 files changed, 3 insertions(+) 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++);