summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUmang Jain <email@uajain.com>2020-05-15 12:42:52 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2020-06-04 11:02:38 +0100
commit5bb6607933f28d2484b68034f871cd58074ae695 (patch)
tree9573a498d98d7663250f4ee6586860cb6164372d
parent5dfd2bfc0dff958394bf08de104384c56a65f626 (diff)
test: log: log_process: Close open fds on error paths
Reported-by: Coverity CID=279097 Signed-off-by: Umang Jain <email@uajain.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--test/log/log_process.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/log/log_process.cpp b/test/log/log_process.cpp
index 8463d0ed..d46d5e35 100644
--- a/test/log/log_process.cpp
+++ b/test/log/log_process.cpp
@@ -107,6 +107,7 @@ protected:
memset(buf, 0, sizeof(buf));
if (read(fd, buf, sizeof(buf)) < 0) {
cerr << "Failed to read tmp log file" << endl;
+ close(fd);
return TestFail;
}
close(fd);