Skip to content

Commit

Permalink
dm: close filepointer before exiting acrn_load_elf()
Browse files Browse the repository at this point in the history
 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: #3817
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
  • Loading branch information
yonghuah authored and acrnsi committed Oct 17, 2019
1 parent b5f77c0 commit d8deaa4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions devicemodel/core/sw_load_elf.c
Expand Up @@ -243,6 +243,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;
Expand Down

0 comments on commit d8deaa4

Please sign in to comment.