From 445cd48e535912030b61ce1ea05acd580a612887 Mon Sep 17 00:00:00 2001 From: Alex Verner <119082209+Retengart@users.noreply.github.com> Date: Tue, 28 Jan 2025 12:22:19 +0300 Subject: [PATCH] fix: delete a partially extracted file if run out of space --- src/Picocrypt.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Picocrypt.go b/src/Picocrypt.go index 0f953a7..640d320 100644 --- a/src/Picocrypt.go +++ b/src/Picocrypt.go @@ -2438,6 +2438,7 @@ func unpackArchive(zipPath string) error { _, writeErr := dstFile.Write(buffer[:n]) if writeErr != nil { dstFile.Close() + os.Remove(dstFile.Name()) return writeErr }