X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Ftarget%2Fdsp563xx.c;h=2e7ac9612617bdd56c6805ac79f09a1e7763f59a;hp=07df36338905e337cc5421e8c736a2c69ec4beef;hb=e77b7447f7b30d70961e5bee45400f70baeb16fc;hpb=f132fcf636361009b4125827351ef01556d49b31 diff --git a/src/target/dsp563xx.c b/src/target/dsp563xx.c index 07df363389..2e7ac96126 100644 --- a/src/target/dsp563xx.c +++ b/src/target/dsp563xx.c @@ -451,7 +451,7 @@ static void dsp563xx_build_reg_cache(struct target *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) * DSP563XX_NUMCOREREGS); + struct reg *reg_list = calloc(DSP563XX_NUMCOREREGS, sizeof(struct reg)); struct dsp563xx_core_reg *arch_info = malloc( sizeof(struct dsp563xx_core_reg) * DSP563XX_NUMCOREREGS); int i;