diff --git a/binfmt/libelf/libelf_init.c b/binfmt/libelf/libelf_init.c index 6658aa0b62b..f2da035e412 100644 --- a/binfmt/libelf/libelf_init.c +++ b/binfmt/libelf/libelf_init.c @@ -134,6 +134,7 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo) /* Clear the load info structure */ memset(loadinfo, 0, sizeof(struct elf_loadinfo_s)); + loadinfo->filfd = -1; /* Get the length of the file. */