FruDevice: fix possible resource leak
file left open when ioctl call fails.
close it before conitnue.
Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
Change-Id: I8f6c489dc5340bb8e67cd24f790feb80445a27ed
diff --git a/src/FruDevice.cpp b/src/FruDevice.cpp
index 78d4635..baab14e 100644
--- a/src/FruDevice.cpp
+++ b/src/FruDevice.cpp
@@ -566,6 +566,7 @@
std::cerr
<< "Error: Could not get the adapter functionality matrix bus "
<< bus << "\n";
+ close(file);
continue;
}
if (!(funcs & I2C_FUNC_SMBUS_READ_BYTE) ||