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.

Tracked-On: #2705
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
Yonghua Huang 2019-03-07 23:22:09 +08:00 committed by Eddie Dong
parent e50c0c88fb
commit 6ac9e15a2b
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}