Merge "bootable/recovery: cleanup compiler warnings (potential leak of memory)" am: d255b661a1 am: be54feda58 am: 83b649ee1d
am: 1bb63f0dc2
Change-Id: Idc9ae978354eb3376f69beb65c926a4d2365a4f9
diff --git a/applypatch/imgdiff.cpp b/applypatch/imgdiff.cpp
index f6087de..4dc4810 100644
--- a/applypatch/imgdiff.cpp
+++ b/applypatch/imgdiff.cpp
@@ -224,6 +224,7 @@
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 @@
}
}
+ free(patch_data);
+ free(patch_size);
+
fclose(f);
return 0;