summary refs log tree commit diff
path: root/Src/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/module.c')
-rw-r--r--Src/module.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/module.c b/Src/module.c
index bcc0ba833..97a4869cd 100644
--- a/Src/module.c
+++ b/Src/module.c
@@ -1597,8 +1597,9 @@ do_load_module(char const *name, int silent)
     ret = try_load_module(name);
     if (!ret && !silent) {
 #ifdef HAVE_DLERROR
+	char *errstr = dlerror();
 	zwarn("failed to load module `%s': %s", name,
-	      metafy(dlerror(), -1, META_USEHEAP));
+	      errstr ? metafy(errstr, -1, META_USEHEAP) : "empty module path");
 #else
 	zwarn("failed to load module: %s", name);
 #endif