mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-14 13:21:13 +00:00
fix: memory leak: buf
Signed-off-by: yuxiaojun <yuxiaojun@uniontech.com>
This commit is contained in:
parent
178c4144ad
commit
86710c9bb2
@ -183,6 +183,7 @@ static struct elf_file *load_elf(const char *filename)
|
||||
buf = (char *)malloc(fsize);
|
||||
if (!buf)
|
||||
{
|
||||
free(ef);
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
}
|
||||
@ -191,6 +192,8 @@ static struct elf_file *load_elf(const char *filename)
|
||||
fclose(fp);
|
||||
if (ret != 1)
|
||||
{
|
||||
free(ef);
|
||||
free(buf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -351,7 +354,11 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
spkimage = create_image(elf, args->core, args->savename, &size);
|
||||
if(elf->data) {
|
||||
free(elf->data);
|
||||
}
|
||||
free(elf);
|
||||
|
||||
|
||||
c = cipher_init(vmk, NULL);
|
||||
cipher_calc_cmac(c, spkimage, size, (uint8_t *) spkimage + size);
|
||||
|
Loading…
x
Reference in New Issue
Block a user