close file when cached font load fails

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27910 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Fred Bauer 2010-08-27 16:48:53 +00:00
parent edb28753b0
commit aaa864ea03
1 changed files with 4 additions and 0 deletions

View File

@ -348,12 +348,16 @@ static bool internal_load_font(struct font* pf, const char *path,
if (!font_load_header(pf))
{
DEBUGF("Failed font header load");
close(pf->fd);
pf->fd = -1;
return false;
}
if (!font_load_cached(pf))
{
DEBUGF("Failed font cache load");
close(pf->fd);
pf->fd = -1;
return false;
}