Skip to content

Commit b51b898

Browse files
yonghuahwenlingz
authored andcommitted
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 <yonghua.huang@intel.com>
1 parent 84c3ee2 commit b51b898

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

devicemodel/core/sw_load_elf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ acrn_load_elf(struct vmctx *ctx, char *elf_file_name, unsigned long *entry,
244244
}
245245

246246
*entry = elf_ehdr->e_entry;
247+
fclose(fp);
247248
free(elf_buf);
248249

249250
return ret;

0 commit comments

Comments
 (0)