X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Ftarget%2Flakemont.c;h=f3795c180bd78a6c4f4c0a74381805076e75ad28;hp=70c785c6a55cc9453e527d0445dc5590317349d2;hb=151c31785a61a25ca06d48691c0dfd5a487f8721;hpb=cb1156421966f648cca0430f74553ebb9259312d diff --git a/src/target/lakemont.c b/src/target/lakemont.c index 70c785c6a5..f3795c180b 100644 --- a/src/target/lakemont.c +++ b/src/target/lakemont.c @@ -375,7 +375,7 @@ struct reg_cache *lakemont_build_reg_cache(struct target *t) int num_regs = ARRAY_SIZE(regs); struct reg_cache **cache_p = register_get_last_cache_p(&t->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 lakemont_core_reg *arch_info = malloc(sizeof(struct lakemont_core_reg) * num_regs); struct reg_feature *feature; int i;