1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-23 02:13:01 +01:00

Merge pull request #314 from al42and/fd_leak

Fixing couple leaking file descriptors
This commit is contained in:
JFreegman 2015-03-18 15:38:40 -04:00
commit 6503349ed3
2 changed files with 3 additions and 0 deletions

View File

@ -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;

View File

@ -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++);