aboutsummaryrefslogtreecommitdiffstats
path: root/applypatch/imgdiff.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-11-30 21:19:41 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-11-30 21:19:42 +0000
commitd255b661a18d9f2e69bf6a301224591a9b7e87a8 (patch)
treec2c3233b4d82f3020910b51a2c24dbfbe3d9d7d8 /applypatch/imgdiff.cpp
parent1528def46e5aa1d5cb6b312dec41490ddacd9a9c (diff)
parent3a5177b16d574c902183d1322367fe7db08fffc1 (diff)
downloadandroid_bootable_recovery-d255b661a18d9f2e69bf6a301224591a9b7e87a8.tar.gz
android_bootable_recovery-d255b661a18d9f2e69bf6a301224591a9b7e87a8.tar.bz2
android_bootable_recovery-d255b661a18d9f2e69bf6a301224591a9b7e87a8.zip
Merge "bootable/recovery: cleanup compiler warnings (potential leak of memory)"
Diffstat (limited to 'applypatch/imgdiff.cpp')
-rw-r--r--applypatch/imgdiff.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/applypatch/imgdiff.cpp b/applypatch/imgdiff.cpp
index f6087de0..4dc48109 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;