FruDevice: fix possible resource leak
File left open when ioctl call fails, which can result in a resource
leak, so it should be closed before continue.
Change-Id: Ieb1188f9ce54d77019b678a1a00282520501a48d
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
diff --git a/src/fru_device.cpp b/src/fru_device.cpp
index 9e270f9..1b612e5 100644
--- a/src/fru_device.cpp
+++ b/src/fru_device.cpp
@@ -755,6 +755,7 @@
{
std::cerr << "Error: Can't use SMBus Receive Byte command bus "
<< bus << "\n";
+ close(file);
continue;
}
auto& device = busmap[bus];