From 832fc23b02eb762ee99aa3dcdfd587e18f30dff8 Mon Sep 17 00:00:00 2001 From: shaojinchun Date: Sun, 31 Mar 2019 14:24:58 +0800 Subject: [PATCH] fix dlmodule_load(): return immediately when open file fail --- components/libc/libdl/dlmodule.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/libc/libdl/dlmodule.c b/components/libc/libdl/dlmodule.c index 0029c01728..14cbfe4cfb 100644 --- a/components/libc/libdl/dlmodule.c +++ b/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 &&