summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Bauer <fred.w.bauer@gmail.com>2010-08-27 16:48:53 +0000
committerFred Bauer <fred.w.bauer@gmail.com>2010-08-27 16:48:53 +0000
commitaaa864ea0314c1619b2b1caf29c8921a7714e751 (patch)
treebe0ae85a4ac75f43caa1b5c78375473e7516d38e
parentedb28753b07a927a9f797c99ec97061499c67d84 (diff)
downloadrockbox-aaa864ea0314c1619b2b1caf29c8921a7714e751.tar.gz
rockbox-aaa864ea0314c1619b2b1caf29c8921a7714e751.tar.bz2
rockbox-aaa864ea0314c1619b2b1caf29c8921a7714e751.zip
close file when cached font load fails
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27910 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/font.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/font.c b/firmware/font.c
index 77cf66c737..7dbc5a258a 100644
--- a/firmware/font.c
+++ b/firmware/font.c
@@ -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;
}