mirror of
git://anongit.mindrot.org/openssh.git
synced 2025-01-03 00:02:05 +00:00
don't call connect() on negative socket
Coverity CID 405037
This commit is contained in:
parent
34ee842cdd
commit
a4c1c2513e
@ -5045,8 +5045,10 @@ connect_local_xsocket_path(const char *pathname)
|
||||
struct sockaddr_un addr;
|
||||
|
||||
sock = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
if (sock == -1)
|
||||
if (sock == -1) {
|
||||
error("socket: %.100s", strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.sun_family = AF_UNIX;
|
||||
strlcpy(addr.sun_path, pathname, sizeof addr.sun_path);
|
||||
|
Loading…
Reference in New Issue
Block a user