mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-22 21:47:22 +00:00
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:
parent
e50c0c88fb
commit
6ac9e15a2b
@ -136,6 +136,7 @@ static int load_elf32(struct vmctx *ctx, FILE *fp, void *buf)
|
|||||||
ctx->lowmem) {
|
ctx->lowmem) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"No enough memory to load elf file\n");
|
"No enough memory to load elf file\n");
|
||||||
|
free(elf32_phdr_bk);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user