diff options
| author | Ha Thach <[email protected]> | 2024-04-16 12:26:34 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-16 12:26:34 +0700 |
| commit | e54023d7657c9c090cdb068ce9352c1bba936f2e (patch) | |
| tree | 94155b84bed5c0ff042e2a9c33fb99024e6e6e64 | |
| parent | bebc00a8516dd55d6f0a0d33e9450eb4a56c1228 (diff) | |
| parent | 10a86172ec5d1dd31122346776bff1f4ea1574e4 (diff) | |
Merge pull request #2354 from slark-yuxj/master
| -rw-r--r-- | .pre-commit-config.yaml | 4 | ||||
| -rw-r--r-- | hw/mcu/sony/cxd56/mkspk/mkspk.c | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4071ec326..bba217cc9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,9 @@ repos: exclude: | (?x)^( .idea/| - hw/bsp/mcx/sdk/ + hw/bsp/mcx/sdk/| + docs/contributing/code_of_conduct.rst| + docs/info/contributors.rst ) - id: forbid-submodules diff --git a/hw/mcu/sony/cxd56/mkspk/mkspk.c b/hw/mcu/sony/cxd56/mkspk/mkspk.c index 3feb235f6..24e0cf77b 100644 --- a/hw/mcu/sony/cxd56/mkspk/mkspk.c +++ b/hw/mcu/sony/cxd56/mkspk/mkspk.c @@ -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,8 +354,12 @@ 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); cipher_deinit(c); |
