Cygwin: sockets: Add missing cleanup if socket/socketpair creation fails
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
4d75035244
commit
b995936ab5
|
@ -548,8 +548,11 @@ cygwin_socket (int af, int type, int protocol)
|
|||
res = fd;
|
||||
}
|
||||
else
|
||||
{
|
||||
delete fh;
|
||||
fd.release ();
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
syscall_printf ("%R = socket(%d, %d (flags %y), %d)",
|
||||
|
@ -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 ();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue