[libcamera-devel] [PATCH 3/4] test: log: log_api: Close open fds on error paths
Umang Jain
email at uajain.com
Mon Apr 13 12:46:53 CEST 2020
Pointed out by Coverity DefectId=279091
Signed-off-by: Umang Jain <email at uajain.com>
---
test/log/log_api.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/test/log/log_api.cpp b/test/log/log_api.cpp
index 33622f8..aeedbf9 100644
--- a/test/log/log_api.cpp
+++ b/test/log/log_api.cpp
@@ -96,6 +96,7 @@ protected:
lseek(fd, 0, SEEK_SET);
if (read(fd, buf, sizeof(buf)) < 0) {
cerr << "Failed to read tmp log file" << endl;
+ close(fd);
return TestFail;
}
close(fd);
--
2.26.0
More information about the libcamera-devel
mailing list