From d2196da73575ab6fafce44ddbe817ae20b61e8c0 Mon Sep 17 00:00:00 2001 From: Michel Pollet Date: Sun, 11 Apr 2010 19:38:24 +0100 Subject: [PATCH] ELF: Fixes a bad malloc How it didn't crash before, no idea... Signed-off-by: Michel Pollet --- simavr/sim/sim_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simavr/sim/sim_elf.c b/simavr/sim/sim_elf.c index 92b9724..c6dbca6 100644 --- a/simavr/sim/sim_elf.c +++ b/simavr/sim/sim_elf.c @@ -228,7 +228,7 @@ int elf_read_firmware(const char * file, elf_firmware_t * firmware) } else { // code if (firmware->codeline[sym.st_value >> 1] == NULL) { - avr_symbol_t * s = firmware->codeline[sym.st_value >> 1] = malloc(sizeof(avr_symbol_t*)); + avr_symbol_t * s = firmware->codeline[sym.st_value >> 1] = malloc(sizeof(avr_symbol_t)); s->symbol = strdup(name); s->addr = sym.st_value; } -- 2.39.5