diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index 4fcc577bb..25f94d684 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -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 (); }