diff options
author | Doug Zongker <dougz@android.com> | 2010-09-16 01:32:52 +0200 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-09-16 01:32:52 +0200 |
commit | 6b1ff61f62db82adf8e47c121cd13c29831ad21b (patch) | |
tree | 8c6fc308e9e26895a46aca7ba7e930dd83fe6a44 /install.c | |
parent | am bd4bc088: am d12560aa: add the ability to seek to a raw location while reading MTD partition (diff) | |
parent | am 8e5e4dad: close update package before installing; allow remount (diff) | |
download | android_bootable_recovery-6b1ff61f62db82adf8e47c121cd13c29831ad21b.tar android_bootable_recovery-6b1ff61f62db82adf8e47c121cd13c29831ad21b.tar.gz android_bootable_recovery-6b1ff61f62db82adf8e47c121cd13c29831ad21b.tar.bz2 android_bootable_recovery-6b1ff61f62db82adf8e47c121cd13c29831ad21b.tar.lz android_bootable_recovery-6b1ff61f62db82adf8e47c121cd13c29831ad21b.tar.xz android_bootable_recovery-6b1ff61f62db82adf8e47c121cd13c29831ad21b.tar.zst android_bootable_recovery-6b1ff61f62db82adf8e47c121cd13c29831ad21b.zip |
Diffstat (limited to '')
-rw-r--r-- | install.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; } |