summaryrefslogtreecommitdiffstats
path: root/install.c
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2010-09-15 06:32:14 +0200
committerAndroid Git Automerger <android-git-automerger@android.com>2010-09-15 06:32:14 +0200
commit858f0a763d0f736eb721f54257b6164886bfcbfc (patch)
treeb1dd9d0f6408811e71dade4f1ccbc52f18114a5e /install.c
parentam d12560aa: add the ability to seek to a raw location while reading MTD partition (diff)
parentclose update package before installing; allow remount (diff)
downloadandroid_bootable_recovery-858f0a763d0f736eb721f54257b6164886bfcbfc.tar
android_bootable_recovery-858f0a763d0f736eb721f54257b6164886bfcbfc.tar.gz
android_bootable_recovery-858f0a763d0f736eb721f54257b6164886bfcbfc.tar.bz2
android_bootable_recovery-858f0a763d0f736eb721f54257b6164886bfcbfc.tar.lz
android_bootable_recovery-858f0a763d0f736eb721f54257b6164886bfcbfc.tar.xz
android_bootable_recovery-858f0a763d0f736eb721f54257b6164886bfcbfc.tar.zst
android_bootable_recovery-858f0a763d0f736eb721f54257b6164886bfcbfc.zip
Diffstat (limited to '')
-rw-r--r--install.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/install.c b/install.c
index 35ba6ca70..40f182d77 100644
--- a/install.c
+++ b/install.c
@@ -42,6 +42,7 @@ try_update_binary(const char *path, ZipArchive *zip) {
const ZipEntry* binary_entry =
mzFindZipEntry(zip, ASSUMED_UPDATE_BINARY_NAME);
if (binary_entry == NULL) {
+ mzCloseZipArchive(zip);
return INSTALL_CORRUPT;
}
@@ -49,11 +50,13 @@ try_update_binary(const char *path, ZipArchive *zip) {
unlink(binary);
int fd = creat(binary, 0755);
if (fd < 0) {
+ mzCloseZipArchive(zip);
LOGE("Can't make %s\n", binary);
return 1;
}
bool ok = mzExtractZipEntryToFile(zip, binary_entry, fd);
close(fd);
+ mzCloseZipArchive(zip);
if (!ok) {
LOGE("Can't copy %s\n", ASSUMED_UPDATE_BINARY_NAME);
@@ -298,6 +301,5 @@ install_package(const char *root_path)
/* Verify and install the contents of the package.
*/
int status = handle_update_package(path, &zip);
- mzCloseZipArchive(&zip);
return status;
}