summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/mcu/sony/cxd56/mkspk/mkspk.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/mcu/sony/cxd56/mkspk/mkspk.c b/hw/mcu/sony/cxd56/mkspk/mkspk.c
index c447ad7da..3feb235f6 100644
--- a/hw/mcu/sony/cxd56/mkspk/mkspk.c
+++ b/hw/mcu/sony/cxd56/mkspk/mkspk.c
@@ -172,6 +172,7 @@ static struct elf_file *load_elf(const char *filename)
ef = (struct elf_file *)malloc(sizeof(*ef));
if (!ef)
{
+ fclose(fp);
return NULL;
}
@@ -182,6 +183,7 @@ static struct elf_file *load_elf(const char *filename)
buf = (char *)malloc(fsize);
if (!buf)
{
+ fclose(fp);
return NULL;
}