Merge "tools/bit: Avoid leak in error condition" am: db43124b01 am: b3851d92ce
am: 739d7864e3

Change-Id: I2ba292aade2c3612b4876af099b9b72fffb45db2
diff --git a/tools/bit/util.cpp b/tools/bit/util.cpp
index 9223931..a502a9d 100644
--- a/tools/bit/util.cpp
+++ b/tools/bit/util.cpp
@@ -241,6 +241,8 @@
 
     char* buf = (char*)malloc(size);
     if ((size_t) size != fread(buf, 1, size, file)) {
+        free(buf);
+        fclose(file);
         return string();
     }