summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2023-09-12 17:43:14 +0700
committerGitHub <[email protected]>2023-09-12 17:43:14 +0700
commit46f7cf4da2959b96d3af6b7f23d0d02ff7187f2f (patch)
treed5c405fa088e3c0e0c8a3464a25a3011f1d50765
parente9ba93315c1cd2b70c47526e0ba6b97e87624d18 (diff)
parentc35061603836353e2e13c7bceafdafced1785dde (diff)
Merge pull request #2235 from slark-yuxj/master
fix:Resource leak: fp
-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;
}