summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclZipfs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c
index 0f4d268..1aec819 100644
--- a/generic/tclZipfs.c
+++ b/generic/tclZipfs.c
@@ -6263,6 +6263,10 @@ void TclZipfsFinalize(void)
* ZipFS.fileHash and ZipFS.zipHash tables.
*/
WriteLock();
+ if (!ZipFS.initialized) {
+ Unlock();
+ return;
+ }
Tcl_HashEntry *hPtr;
Tcl_HashSearch zipSearch;
@@ -6285,7 +6289,10 @@ void TclZipfsFinalize(void)
Tcl_FSUnregister(&zipfsFilesystem);
Tcl_DeleteHashTable(&ZipFS.fileHash);
Tcl_DeleteHashTable(&ZipFS.zipHash);
- ckfree(ZipFS.fallbackEntryEncoding);
+ if (ZipFS.fallbackEntryEncoding) {
+ ckfree(ZipFS.fallbackEntryEncoding);
+ ZipFS.fallbackEntryEncoding = NULL;
+ }
ZipFS.initialized = 0;
}
}