malloc -> calloc

This commit is contained in:
Sergey Lyubka committed 2025-06-24 09:12:38 +01:00
1 parent 86334e9040
commit 5f1f4a0df8
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -150,7 +150,7 @@ fwxit:
// try to swap (honor dual image), otherwise just overwrite
MG_IRAM static void single_bank_swap(char *p1, char *p2, size_t s, size_t ss) {
char *tmp = malloc(ss);
char *tmp = calloc(1, ss);
// no stdlib calls here
for (size_t ofs = 0; ofs < s; ofs += ss) {
if (tmp != NULL)
+1 -1
View File
@@ -100,7 +100,7 @@ static bool __no_inline_not_in_flash_func(mg_picosdk_write)(void *addr,
static void __no_inline_not_in_flash_func(single_bank_swap)(char *p1, char *p2,
size_t s,
size_t ss) {
char *tmp = malloc(ss);
char *tmp = calloc(1, ss);
if (tmp == NULL) return;
#if PICO_RP2040
uint32_t xip[256 / sizeof(uint32_t)];