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>
This commit is contained in:
Umang Jain 2020-05-15 12:42:52 +00:00 committed by Kieran Bingham
parent 5dfd2bfc0d
commit 5bb6607933

View file

@ -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);