mirror of
https://github.com/clearml/dropbear
synced 2025-06-26 18:17:32 +00:00
Fix FD leak if connect() fails, found by Klocwork
--HG-- extra : convert_revision : 4f7dec450bb69aee8d7789b8ab10311b1d1655bb
This commit is contained in:
parent
2028b1b517
commit
72c446f160
1
dbutil.c
1
dbutil.c
@ -311,6 +311,7 @@ int connect_unix(const char* path) {
|
|||||||
}
|
}
|
||||||
if (connect(fd, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
|
if (connect(fd, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
|
||||||
TRACE(("Failed to connect to '%s' socket", path))
|
TRACE(("Failed to connect to '%s' socket", path))
|
||||||
|
m_close(fd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return fd;
|
return fd;
|
||||||
|
Loading…
Reference in New Issue
Block a user