Cygwin: sockets: Add missing cleanup if socket/socketpair creation fails

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2018-02-26 18:02:36 +01:00
parent 4d75035244
commit b995936ab5
1 changed files with 6 additions and 1 deletions

View File

@ -548,7 +548,10 @@ cygwin_socket (int af, int type, int protocol)
res = fd;
}
else
fd.release ();
{
delete fh;
fd.release ();
}
}
done:
@ -2346,6 +2349,8 @@ socketpair (int af, int type, int protocol, int *sb)
}
else
{
delete fh_in;
delete fh_out;
fd_in.release ();
fd_out.release ();
}