1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-07-03 15:47:46 +02:00

fix memory leak

This commit is contained in:
Michael Rose 2013-08-14 09:31:19 +02:00
parent 1158930641
commit 076ea43c07

3
main.c
View File

@ -308,10 +308,13 @@ static int store_data(char *path)
fd = fopen(path, "w");
if (fd == NULL) {
free(buf);
return 2;
}
if (fwrite(buf, len, 1, fd) != 1) {
free(buf);
fclose(fd);
return 3;
}