fix: delete a partially extracted file if run out of space

This commit is contained in:
Alex Verner 2025-01-28 12:22:19 +03:00
parent 46b557e3ef
commit 445cd48e53

View file

@ -2438,6 +2438,7 @@ func unpackArchive(zipPath string) error {
_, writeErr := dstFile.Write(buffer[:n]) _, writeErr := dstFile.Write(buffer[:n])
if writeErr != nil { if writeErr != nil {
dstFile.Close() dstFile.Close()
os.Remove(dstFile.Name())
return writeErr return writeErr
} }