dm: fix possible memory leak in 'load_elf32()'
Dynamic memory stored in 'elf32_phdr' allocated
through 'calloc' be lost.
the patch port from apl_sdc_stable branch.
Acked-by: Yin Fengwei
@@ -136,6 +136,7 @@ static int load_elf32(struct vmctx *ctx, FILE *fp, void *buf)
ctx->lowmem) {
fprintf(stderr,
"No enough memory to load elf file\n");
+ free(elf32_phdr_bk);
return -1;
}
