Explorar o código

fix dlmodule_load(): return immediately when open file fail

shaojinchun %!s(int64=6) %!d(string=hai) anos
pai
achega
832fc23b02
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      components/libc/libdl/dlmodule.c

+ 4 - 0
components/libc/libdl/dlmodule.c

@@ -442,6 +442,10 @@ struct rt_dlmodule* dlmodule_load(const char* filename)
         close(fd);
         fd = -1;
     }
+    else
+    {
+        goto __exit;
+    }
 
     /* check ELF header */
     if (rt_memcmp(elf_module->e_ident, RTMMAG, SELFMAG) != 0 &&