summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpooryorick <com.digitalsmarties@pooryorick.com>2018-06-18 05:59:22 (GMT)
committerpooryorick <com.digitalsmarties@pooryorick.com>2018-06-18 05:59:22 (GMT)
commite9c0ec1219e3c42df67c414bfda0bb5aab9a5bbb (patch)
tree0235302100c65242e670dde18610bdea2697cd10
parent8047a470ef35faeafe18de166f773a78097b3fc2 (diff)
downloadtcl-e9c0ec1219e3c42df67c414bfda0bb5aab9a5bbb.zip
tcl-e9c0ec1219e3c42df67c414bfda0bb5aab9a5bbb.tar.gz
tcl-e9c0ec1219e3c42df67c414bfda0bb5aab9a5bbb.tar.bz2
Plug leak in TclSetEnv.
-rw-r--r--generic/tclEnv.c4
-rw-r--r--tests/pkgIndex.tcl8
2 files changed, 8 insertions, 4 deletions
diff --git a/generic/tclEnv.c b/generic/tclEnv.c
index 8cc4b74..c559c69 100644
--- a/generic/tclEnv.c
+++ b/generic/tclEnv.c
@@ -730,6 +730,10 @@ TclFinalizeEnvironment(void)
ckfree(env.cache);
env.cache = NULL;
env.cacheSize = 0;
+ if ((env.ourEnviron != NULL)) {
+ ckfree(env.ourEnviron);
+ env.ourEnviron = NULL;
+ }
#ifndef USE_PUTENV
env.ourEnvironSize = 0;
#endif
diff --git a/tests/pkgIndex.tcl b/tests/pkgIndex.tcl
index 48ab71b..0feb0eb 100644
--- a/tests/pkgIndex.tcl
+++ b/tests/pkgIndex.tcl
@@ -1,6 +1,6 @@
#! /usr/bin/env tclsh
-package ifneeded tcltests 0.1 {
- source [file dirname [file dirname [file normalize [info script]/...]]]/tcltests.tcl
- package provide tcltests 0.1
-}
+package ifneeded tcltests 0.1 "
+ source [list $dir]/tcltests.tcl
+ package provide tcltests 0.1
+"