diff options
author | dgp <dgp@users.sourceforge.net> | 2019-04-22 15:15:47 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2019-04-22 15:15:47 (GMT) |
commit | 0f9539f83840432a6d510b8c8afe52e24a11e6b4 (patch) | |
tree | c4c08922f80828c8d5fc97ad39ea02e832095eb4 | |
parent | e240d7269b3b361572433bfb7a49a78eb14f2ac8 (diff) | |
download | tcl-0f9539f83840432a6d510b8c8afe52e24a11e6b4.zip tcl-0f9539f83840432a6d510b8c8afe52e24a11e6b4.tar.gz tcl-0f9539f83840432a6d510b8c8afe52e24a11e6b4.tar.bz2 |
Stop leaking ZipFile in MountBuffer()
-rw-r--r-- | generic/tclZipfs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index b5cf69f..c3887f0 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -1711,6 +1711,7 @@ TclZipfs_MountBuffer( int copy) { ZipFile *zf; + int result; ReadLock(); if (!ZipFS.initialized) { @@ -1772,8 +1773,10 @@ TclZipfs_MountBuffer( if (ZipFSFindTOC(interp, 0, zf) != TCL_OK) { return TCL_ERROR; } - return ZipFSCatalogFilesystem(interp, zf, mountPoint, NULL, + result = ZipFSCatalogFilesystem(interp, zf, mountPoint, NULL, "Memory Buffer"); + ckfree(zf); + return result; } /* |