Fix FD leak if connect() fails, found by Klocwork

--HG--
extra : convert_revision : 4f7dec450bb69aee8d7789b8ab10311b1d1655bb
This commit is contained in:
Matt Johnston 2011-04-07 13:05:10 +00:00
parent 2028b1b517
commit 72c446f160

View File

@ -311,6 +311,7 @@ int connect_unix(const char* path) {
}
if (connect(fd, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
TRACE(("Failed to connect to '%s' socket", path))
m_close(fd);
return -1;
}
return fd;