summary refs log tree commit diff
path: root/Src/module.c
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2015-01-25 18:28:50 +0100
committerMikael Magnusson <mikachu@gmail.com>2015-01-27 00:17:23 +0100
commitbac2bbd05893dff4be88c7914116374c0f27932d (patch)
tree27cb0e029ef6cd6488e345d373ab2468630e1b86 /Src/module.c
parent513662859905e132d29bb82ba4fe5c1ea8de0a44 (diff)
downloadzsh-bac2bbd05893dff4be88c7914116374c0f27932d.tar.gz
zsh-bac2bbd05893dff4be88c7914116374c0f27932d.tar.xz
zsh-bac2bbd05893dff4be88c7914116374c0f27932d.zip
34382: Handle NULL return from dlerror() more gracefully
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