summaryrefslogtreecommitdiffstats
path: root/generic/tclThreadStorage.c
diff options
context:
space:
mode:
authordonal.k.fellows@manchester.ac.uk <dkf>2009-03-15 22:34:58 (GMT)
committerdonal.k.fellows@manchester.ac.uk <dkf>2009-03-15 22:34:58 (GMT)
commit4aecb3e1cab0b45f9a564086f19009cd63021bac (patch)
tree76539d6a771d741bdb62f666ec09b879e4467dd5 /generic/tclThreadStorage.c
parent0da9b7c9b89c8f48063c5203f9b16e5a79d7832d (diff)
downloadtcl-4aecb3e1cab0b45f9a564086f19009cd63021bac.zip
tcl-4aecb3e1cab0b45f9a564086f19009cd63021bac.tar.gz
tcl-4aecb3e1cab0b45f9a564086f19009cd63021bac.tar.bz2
Fix [Bug 2687952]
Diffstat (limited to 'generic/tclThreadStorage.c')
-rw-r--r--generic/tclThreadStorage.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/generic/tclThreadStorage.c b/generic/tclThreadStorage.c
index 1568998..adcf1d3 100644
--- a/generic/tclThreadStorage.c
+++ b/generic/tclThreadStorage.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclThreadStorage.c,v 1.18 2008/11/29 12:18:35 dkf Exp $
+ * RCS: @(#) $Id: tclThreadStorage.c,v 1.19 2009/03/15 22:34:59 dkf Exp $
*/
#include "tclInt.h"
@@ -110,6 +110,19 @@ static void
TSDTableDelete(
TSDTable *tsdTablePtr)
{
+ sig_atomic_t i;
+
+ for (i=0 ; i<tsdTablePtr->allocated ; i++) {
+ if (tsdTablePtr->tablePtr[i] != NULL) {
+ /*
+ * These values were allocated in Tcl_GetThreadData in tclThread.c
+ * and must now be deallocated or they will leak.
+ */
+
+ TclpSysFree((char *) tsdTablePtr->tablePtr[i]);
+ }
+ }
+
TclpSysFree(tsdTablePtr->tablePtr);
TclpSysFree(tsdTablePtr);
}