X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Ftarget%2Favr32_ap7k.c;h=e1812eccb049dfdd47d1a698ee24c817aac84c3b;hp=70af8c3ed5615db120bb8471febc7d4f5d3abbf7;hb=e77b7447f7b30d70961e5bee45400f70baeb16fc;hpb=f132fcf636361009b4125827351ef01556d49b31 diff --git a/src/target/avr32_ap7k.c b/src/target/avr32_ap7k.c index 70af8c3ed5..e1812eccb0 100644 --- a/src/target/avr32_ap7k.c +++ b/src/target/avr32_ap7k.c @@ -178,7 +178,7 @@ static struct reg_cache *avr32_build_reg_cache(struct target *target) struct avr32_ap7k_common *ap7k = target_to_ap7k(target); struct reg_cache **cache_p = register_get_last_cache_p(&target->reg_cache); struct reg_cache *cache = malloc(sizeof(struct reg_cache)); - struct reg *reg_list = malloc(sizeof(struct reg) * num_regs); + struct reg *reg_list = calloc(num_regs, sizeof(struct reg)); struct avr32_core_reg *arch_info = malloc(sizeof(struct avr32_core_reg) * num_regs); int i;