Fix file descriptor leak on error
Credit goes to cppcheck. Signed-off-by: Thomas Jarosch <[email protected]>
This commit is contained in:
committed by
Martin Willi
parent
8e3f14baab
commit
848567fdf2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user