Fix file descriptor leak on error

Credit goes to cppcheck.

Signed-off-by: Thomas Jarosch <[email protected]>
This commit is contained in:
Thomas Jarosch
2011-08-29 09:10:28 +02:00
committed by Martin Willi
parent 8e3f14baab
commit 848567fdf2
+1
View File
@@ -965,6 +965,7 @@ static bool parse_file(linked_list_t *contents, char *file, int level,
if (fread(text, 1, len, fd) != len)
{
free(text);
fclose(fd);
return FALSE;
}
fclose(fd);