Fix Coverity CID 978183 Resource leak in rexec().
Close the socket if connect() fails to avoid leaking it. Reported by: Coverity CID: 978183 MFC after: 1 week
This commit is contained in:
parent
9b842193f9
commit
d7807d5167
@ -330,6 +330,7 @@ rexec(ahost, rport, name, pass, cmd, fd2p)
|
||||
goto retry;
|
||||
}
|
||||
perror(hp->h_name);
|
||||
(void) close(s);
|
||||
return (-1);
|
||||
}
|
||||
port = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user