summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authordavygrvy@pobox.com <davygrvy>2004-05-05 18:28:39 (GMT)
committerdavygrvy@pobox.com <davygrvy>2004-05-05 18:28:39 (GMT)
commit16537de34b54e907d8c82ab6f140ac51c8149e70 (patch)
treebd3a153869840305d312d74e7f45699bbfd8b20b /generic/tclEncoding.c
parentc30b9ffd25e939cc4b10beefaf4154d779850a1a (diff)
downloadtcl-16537de34b54e907d8c82ab6f140ac51c8149e70.zip
tcl-16537de34b54e907d8c82ab6f140ac51c8149e70.tar.gz
tcl-16537de34b54e907d8c82ab6f140ac51c8149e70.tar.bz2
(TclFinalizeEncodingSubsystem): FreeEncoding(systemEncoding); moved to
before the hash table itereation as it was causing a double free attempt under some conditions.
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index f1781e5..23b2632 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclEncoding.c,v 1.20 2004/04/20 02:15:55 davygrvy Exp $
+ * RCS: @(#) $Id: tclEncoding.c,v 1.21 2004/05/05 18:28:39 davygrvy Exp $
*/
#include "tclInt.h"
@@ -313,6 +313,7 @@ TclFinalizeEncodingSubsystem()
Tcl_MutexLock(&encodingMutex);
encodingsInitialized = 0;
+ FreeEncoding(systemEncoding);
hPtr = Tcl_FirstHashEntry(&encodingTable, &search);
while (hPtr != NULL) {
/*
@@ -324,7 +325,6 @@ TclFinalizeEncodingSubsystem()
FreeEncoding((Tcl_Encoding) Tcl_GetHashValue(hPtr));
hPtr = Tcl_FirstHashEntry(&encodingTable, &search);
}
- FreeEncoding(systemEncoding);
Tcl_DeleteHashTable(&encodingTable);
Tcl_MutexUnlock(&encodingMutex);
}