bootable/recovery: cleanup compiler warnings (potential leak of memory)

bootable/recovery/applypatch/imgdiff.cpp:195:5: warning: Potential leak
of memory pointed to by 'img' [clang-analyzer-unix.Malloc]

Bug: 26936282
Test: WITH_TIDY=1 WITH_STATIC_ANALYZER=1 mm
Change-Id: Ie79c780233ddfebf85686a24df3bf2561f831580
This commit is contained in:
Rahul Chaudhry
2016-12-06 15:10:41 -08:00
parent 3aadbbac39
commit 8b640ffabc

View File

@@ -194,6 +194,7 @@ unsigned char* ReadZip(const char* filename,
if (fread(img, 1, sz, f) != sz) {
printf("failed to read \"%s\" %s\n", filename, strerror(errno));
fclose(f);
free(img);
return NULL;
}
fclose(f);