JobServer: fix socket leaks

Found by Coverity Scan, CID 25600.

Change-Id: Ic0c549928ce8058c145d178ed06b41b543676460
This commit is contained in:
Horst Schirmeier
2015-02-07 18:20:30 +01:00
parent b01a5e80fd
commit 8c2b6cf028
+2
View File
@@ -152,6 +152,7 @@ void JobServer::run()
/* Listen with a backlog of maxThreads */
if (listen(s, m_maxThreads) == -1) {
perror("listen");
close(s);
// TODO: Log-level?
return;
}
@@ -165,6 +166,7 @@ void JobServer::run()
if (cs < 0) {
if (errno != EWOULDBLOCK) {
perror("poll/accept");
close(s);
// TODO: Log-level?
return;
} else {