summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-11-30 22:44:56 +0100
committerandroid-build-merger <android-build-merger@google.com>2016-11-30 22:44:56 +0100
commit449467393af6a44fa1fff7039afb1d5ff7dbd0f9 (patch)
tree78986ae4bdf2cf7a456e50b1d0c3fbfbf32571d3
parentMerge "Switch update verifier to HIDL HAL" am: 1528def46e am: ae2463bb35 am: 95beb966e2 (diff)
parentMerge "bootable/recovery: cleanup compiler warnings (potential leak of memory)" am: d255b661a1 am: be54feda58 (diff)
downloadandroid_bootable_recovery-449467393af6a44fa1fff7039afb1d5ff7dbd0f9.tar
android_bootable_recovery-449467393af6a44fa1fff7039afb1d5ff7dbd0f9.tar.gz
android_bootable_recovery-449467393af6a44fa1fff7039afb1d5ff7dbd0f9.tar.bz2
android_bootable_recovery-449467393af6a44fa1fff7039afb1d5ff7dbd0f9.tar.lz
android_bootable_recovery-449467393af6a44fa1fff7039afb1d5ff7dbd0f9.tar.xz
android_bootable_recovery-449467393af6a44fa1fff7039afb1d5ff7dbd0f9.tar.zst
android_bootable_recovery-449467393af6a44fa1fff7039afb1d5ff7dbd0f9.zip
-rw-r--r--applypatch/imgdiff.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/applypatch/imgdiff.cpp b/applypatch/imgdiff.cpp
index f6087de01..4dc481093 100644
--- a/applypatch/imgdiff.cpp
+++ b/applypatch/imgdiff.cpp
@@ -224,6 +224,7 @@ unsigned char* ReadZip(const char* filename,
for (i = 0; i < cdcount; ++i) {
if (!(cd[0] == 0x50 && cd[1] == 0x4b && cd[2] == 0x01 && cd[3] == 0x02)) {
printf("bad central directory entry %d\n", i);
+ free(temp_entries);
return NULL;
}
@@ -1062,6 +1063,9 @@ int main(int argc, char** argv) {
}
}
+ free(patch_data);
+ free(patch_size);
+
fclose(f);
return 0;