summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorandreask <andreask>2012-08-27 17:12:06 (GMT)
committerandreask <andreask>2012-08-27 17:12:06 (GMT)
commit1365d5dfb2e603dd60110cae31172da00d07a47a (patch)
treeb0f08ba55851c5470ae19a767294afead361c59b /unix
parent98b9b2bdbdb0c5135b279eebec7214284a3d4072 (diff)
downloadtcl-1365d5dfb2e603dd60110cae31172da00d07a47a.zip
tcl-1365d5dfb2e603dd60110cae31172da00d07a47a.tar.gz
tcl-1365d5dfb2e603dd60110cae31172da00d07a47a.tar.bz2
Followup to [6325d5dbeac6f91d28d6]. dlerror() may return NULL. Fixed the code which wasn't prepared to deal with that.
Diffstat (limited to 'unix')
-rw-r--r--unix/tclLoadDl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c
index f8fe6d3..a48aa23 100644
--- a/unix/tclLoadDl.c
+++ b/unix/tclLoadDl.c
@@ -176,8 +176,14 @@ FindSymbol(
}
Tcl_DStringFree(&ds);
if (proc == NULL && interp != NULL) {
+ const char *errorStr = dlerror();
+
+ if (!errorStr) {
+ errorStr = "unknown";
+ }
+
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "cannot find symbol \"%s\": %s", symbol, dlerror()));
+ "cannot find symbol \"%s\": %s", symbol, errorStr));
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol,
NULL);
}