diff options
-rw-r--r-- | unix/tclUnixTest.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/unix/tclUnixTest.c b/unix/tclUnixTest.c index e6812a7..cbc2639 100644 --- a/unix/tclUnixTest.c +++ b/unix/tclUnixTest.c @@ -423,8 +423,10 @@ TestfindexecutableCmd(clientData, interp, argc, argv) oldName = tclExecutableName; tclExecutableName = NULL; Tcl_FindExecutable(argv[1]); - Tcl_SetResult(interp, tclExecutableName, TCL_DYNAMIC); - ckfree(tclExecutableName); + if (tclExecutableName != NULL) { + Tcl_SetResult(interp, tclExecutableName, TCL_VOLATILE); + ckfree(tclExecutableName); + } tclExecutableName = oldName; return TCL_OK; } |