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

Commit edafac6c authored by WiZarD's avatar WiZarD Committed by Winny Mathew Kurian
Browse files

Free mmaped area if keys fail to load



Keys for package verification is loaded after the update
package is mmaped into memory. This mmaped area needs
to be freed when exiting the function.

Another approach would be to mmap after loading the keys.

Change-Id: Ib77711a8acd5c363b5517da12dc311fb8f9f4605
Signed-off-by: default avatarWiZarD <WiZarD.Devel@gmail.com>
parent c158cf0a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -229,6 +229,7 @@ really_install_package(const char *path, bool* wipe_cache, bool needs_mount)
    std::vector<Certificate> loadedKeys;
    if (!load_keys(PUBLIC_KEYS_FILE, loadedKeys)) {
        LOGE("Failed to load keys\n");
        sysReleaseMap(&map);
        return INSTALL_CORRUPT;
    }
    LOGI("%zu key(s) loaded from %s\n", loadedKeys.size(), PUBLIC_KEYS_FILE);