summaryrefslogtreecommitdiffstats
path: root/unix/tclLoadDl.c
diff options
context:
space:
mode:
authorandreask <andreask>2012-08-27 17:12:06 (GMT)
committerandreask <andreask>2012-08-27 17:12:06 (GMT)
commite7975ff335f51d429c79b128209d33f7808f3782 (patch)
treeb0f08ba55851c5470ae19a767294afead361c59b /unix/tclLoadDl.c
parentb71431513bf64dcf7aeb53bd0788714c55171e90 (diff)
downloadtcl-e7975ff335f51d429c79b128209d33f7808f3782.zip
tcl-e7975ff335f51d429c79b128209d33f7808f3782.tar.gz
tcl-e7975ff335f51d429c79b128209d33f7808f3782.tar.bz2
Followup to [6325d5dbeac6f91d28d6]. dlerror() may return NULL. Fixed the code which wasn't prepared to deal with that.
Diffstat (limited to 'unix/tclLoadDl.c')
-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);
}