Avoid closing unallocated socket in case socreate fails.

Found by: Brainy Code Scanner
Reported by: Maxime Villard <max@M00nBSD.net>
MFC after: 2 weeks
This commit is contained in:
Alexander Kabaev 2015-02-28 20:30:29 +00:00
parent 3956b1013e
commit 2b7432629c

View File

@ -220,7 +220,7 @@ krpc_call(struct sockaddr_in *sa, u_int prog, u_int vers, u_int func,
* Create socket and set its recieve timeout.
*/
if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0, td->td_ucred, td)))
goto out;
return error;
tv.tv_sec = 1;
tv.tv_usec = 0;