From edafac6c7b76d1ff7335d5b532f7d92816073ec5 Mon Sep 17 00:00:00 2001 From: WiZarD Date: Mon, 8 Aug 2016 10:30:16 +0530 Subject: 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: WiZarD --- install.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/install.cpp b/install.cpp index 9106db595..fa7b73e56 100644 --- a/install.cpp +++ b/install.cpp @@ -229,6 +229,7 @@ really_install_package(const char *path, bool* wipe_cache, bool needs_mount) std::vector 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); -- cgit v1.2.3