From b51b89807fd404c34dea883492d355102b5393da Mon Sep 17 00:00:00 2001 From: Yonghua Huang Date: Tue, 15 Oct 2019 11:52:06 +0800 Subject: [PATCH] dm: close filepointer before exiting acrn_load_elf() In acrn_load_elf(), file pointer 'fp' is kept in open state before exiting if 'load_elf32()' is executed, this patch is to fix this bug. Tracked-On: #4085 Signed-off-by: Yonghua Huang --- devicemodel/core/sw_load_elf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/devicemodel/core/sw_load_elf.c b/devicemodel/core/sw_load_elf.c index a3b8778ad..aa14bb2d0 100644 --- a/devicemodel/core/sw_load_elf.c +++ b/devicemodel/core/sw_load_elf.c @@ -244,6 +244,7 @@ acrn_load_elf(struct vmctx *ctx, char *elf_file_name, unsigned long *entry, } *entry = elf_ehdr->e_entry; + fclose(fp); free(elf_buf); return ret;