From: wessels <> Date: Thu, 17 Jul 1997 04:56:38 +0000 (+0000) Subject: in comm_open close the fd if commBind() fails X-Git-Tag: SQUID_3_0_PRE1~4874 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3724d50cee0b651d8ca582cddd73c692d042677;p=thirdparty%2Fsquid.git in comm_open close the fd if commBind() fails --- diff --git a/src/comm.cc b/src/comm.cc index 32490b2375..71d5f6526c 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,5 +1,5 @@ /* - * $Id: comm.cc,v 1.180 1997/07/16 20:32:01 wessels Exp $ + * $Id: comm.cc,v 1.181 1997/07/16 22:56:38 wessels Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -282,9 +282,12 @@ comm_open(int sock_type, if (do_reuse) commSetReuseAddr(new_socket); } - if (addr.s_addr != no_addr.s_addr) - if (commBind(new_socket, addr, port) != COMM_OK) + if (addr.s_addr != no_addr.s_addr) { + if (commBind(new_socket, addr, port) != COMM_OK) { + comm_close(new_socket); return COMM_ERROR; + } + } F->local_port = port; if (BIT_TEST(flags, COMM_NONBLOCKING))