diff --git a/test/log/log_api.cpp b/test/log/log_api.cpp index 6f3248a79..ae3c607a6 100644 --- a/test/log/log_api.cpp +++ b/test/log/log_api.cpp @@ -87,6 +87,7 @@ protected: if (logSetFile(path) < 0) { cerr << "Failed to set log file" << endl; + close(fd); return TestFail; } @@ -97,6 +98,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);