Skip to content

ArchiveReader: Cleanup tempdirs/files#623

Open
dcantah wants to merge 1 commit intoapple:mainfrom
dcantah:fix-archivereader-tempdir-leaks
Open

ArchiveReader: Cleanup tempdirs/files#623
dcantah wants to merge 1 commit intoapple:mainfrom
dcantah:fix-archivereader-tempdir-leaks

Conversation

@dcantah
Copy link
Copy Markdown
Member

@dcantah dcantah commented Mar 31, 2026

There was a couple spots we were leaving around tempdirs

There was a couple spots we were leaving around tempdirs
try? FileManager.default.removeItem(at: tempDir)
throw error
}
// Register for cleanup in deinit (only needed when the zstd path didn't already set it)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We added the tempDecompressedFile specifically because we needed to try to uncompress zstd before invoking libarchive (with either the uncompressed zstd file or the original file if not zstd).

Here it looks like we're writing ZIP-format data into a temp directory created by the call but subsequently owned by the user when init returns? If the data's in the temp directory, why would we need to set tempDecompressedFile for this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants