Skip to content

Commit

Permalink
Fix memory leak in ZipFSPathInFilesystemProc().
Browse files Browse the repository at this point in the history
  • Loading branch information
pooryorick committed Mar 18, 2023
1 parent 836b156 commit 9e672e1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions generic/tclZipfs.c
Expand Up @@ -5221,13 +5221,15 @@ ZipFSPathInFilesystemProc(
Tcl_HashSearch search;
int ret = -1;
size_t len;
Tcl_Obj *normPathPtr;
char *path;

pathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr);
if (!pathPtr) {
normPathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr);
if (!normPathPtr) {
return -1;
}
path = Tcl_GetStringFromObj(pathPtr, &len);
path = Tcl_GetStringFromObj(normPathPtr, &len);
Tcl_DecrRefCount(normPathPtr);
if (strncmp(path, ZIPFS_VOLUME, ZIPFS_VOLUME_LEN) != 0) {
return -1;
}
Expand Down

0 comments on commit 9e672e1

Please sign in to comment.