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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user