Skip to content

Commit e54023d

Browse files
authored
Merge pull request #2354 from slark-yuxj/master
2 parents bebc00a + 10a8617 commit e54023d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.pre-commit-config.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ repos:
1616
exclude: |
1717
(?x)^(
1818
.idea/|
19-
hw/bsp/mcx/sdk/
19+
hw/bsp/mcx/sdk/|
20+
docs/contributing/code_of_conduct.rst|
21+
docs/info/contributors.rst
2022
)
2123
- id: forbid-submodules
2224

hw/mcu/sony/cxd56/mkspk/mkspk.c

+7
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ static struct elf_file *load_elf(const char *filename)
183183
buf = (char *)malloc(fsize);
184184
if (!buf)
185185
{
186+
free(ef);
186187
fclose(fp);
187188
return NULL;
188189
}
@@ -191,6 +192,8 @@ static struct elf_file *load_elf(const char *filename)
191192
fclose(fp);
192193
if (ret != 1)
193194
{
195+
free(ef);
196+
free(buf);
194197
return NULL;
195198
}
196199

@@ -351,8 +354,12 @@ int main(int argc, char **argv)
351354
}
352355

353356
spkimage = create_image(elf, args->core, args->savename, &size);
357+
if(elf->data) {
358+
free(elf->data);
359+
}
354360
free(elf);
355361

362+
356363
c = cipher_init(vmk, NULL);
357364
cipher_calc_cmac(c, spkimage, size, (uint8_t *) spkimage + size);
358365
cipher_deinit(c);

0 commit comments

Comments
 (0)