From 7a1c8f41cd17b5052fadd9bcef1c34146fd41ca7 Mon Sep 17 00:00:00 2001 From: Francesco Puntillo Date: Wed, 25 May 2016 10:49:27 +0800 Subject: [PATCH] Fix memory leak in unzip method --- Zip/Zip.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Zip/Zip.swift b/Zip/Zip.swift index 1284835..4ae40fe 100644 --- a/Zip/Zip.swift +++ b/Zip/Zip.swift @@ -96,6 +96,9 @@ public class Zip { // Begin unzipping let zip = unzOpen64(path) + defer { + unzClose(zip) + } if unzGoToFirstFile(zip) != UNZ_OK { throw ZipError.UnzipFail } -- 2.26.2