Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f447666 authored by Flamefire's avatar Flamefire Committed by Gerrit Code Review
Browse files

Fix ressource leak in getFileCrC

Change-Id: If8a63fa355664d360aab6ecba92c82cd56b745b8
parent bbc81475
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -5850,8 +5850,9 @@ public class PackageManagerService extends IPackageManager.Stub {
    }
    private byte[] getFileCrC(String path) {
        ZipFile zfile = null;
        try {
            ZipFile zfile = new ZipFile(path);
            zfile = new ZipFile(path);
            ZipEntry entry = zfile.getEntry("META-INF/MANIFEST.MF");
            if (entry == null) {
                Log.e(TAG, "Unable to get MANIFEST.MF from " + path);
@@ -5862,6 +5863,8 @@ public class PackageManagerService extends IPackageManager.Stub {
            if (crc == -1) Log.e(TAG, "Unable to get CRC for " + path);
            return ByteBuffer.allocate(8).putLong(crc).array();
        } catch (Exception e) {
        } finally {
            IoUtils.closeQuietly(zfile);
        }
        return null;
    }