summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/lt_path.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/lt_path.c b/src/core/lt_path.c
index ba19135..c0205d7 100644
--- a/src/core/lt_path.c
+++ b/src/core/lt_path.c
@@ -375,10 +375,16 @@ static struct lt_modctx * lt_dlopen_locked(
/* path open (module) */
if (module) {
- if ((fdmod = lt_dlpathopen_locked(module,extv,&mpath)) < 0)
- return 0;
+ fdmod = lt_dlpathopen_locked(
+ module,extv,&mpath);
+
+ if (fdmod >= 0) {
+ close(fdmod);
- close(fdmod);
+ } else if (!(mpath = strdup(module))) {
+ lt_setstatus(0,SLTDL_ERR_SYSTEM_ERROR);
+ return 0;
+ }
}
/* entry alloc */