From 6b9e5c766be9379a612443b37f6a5daaaf808000 Mon Sep 17 00:00:00 2001 From: vhaudiquet Date: Sun, 8 Oct 2023 14:09:20 +0200 Subject: [PATCH] rv32cpu: allocated with calloc (for debug) --- src/cpu/rv32cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpu/rv32cpu.c b/src/cpu/rv32cpu.c index 37af05a..c3d26a8 100644 --- a/src/cpu/rv32cpu.c +++ b/src/cpu/rv32cpu.c @@ -39,7 +39,7 @@ static void cpu_print_instruction(instruction_t* instruction); void cpu_init() { - cpu0 = malloc(sizeof(rv32_cpu_t)); + cpu0 = calloc(1, sizeof(rv32_cpu_t)); cpu0->regs.zero = 0; }