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:
Don Lewis 2016-05-25 07:26:22 +00:00
parent 9b842193f9
commit d7807d5167

View File

@ -330,6 +330,7 @@ rexec(ahost, rport, name, pass, cmd, fd2p)
goto retry;
}
perror(hp->h_name);
(void) close(s);
return (-1);
}
port = 0;