PR#3342 fix resource leak coverity issue 966577
authorTim Hudson <tjh@cryptsoft.com>
Mon, 5 May 2014 00:39:30 +0000 (10:39 +1000)
committerMatt Caswell <matt@openssl.org>
Thu, 8 May 2014 22:22:21 +0000 (23:22 +0100)
apps/s_socket.c

index e0de63c8f1995cea7e7e5909080c2e736d945ea7..a7fa28b7d90351449865e916f1e1c6d9fa16148b 100644 (file)
@@ -274,7 +274,7 @@ static int init_client_ip(int *sock, unsigned char ip[4], int port, int type)
                {
                i=0;
                i=setsockopt(s,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i));
-               if (i < 0) { perror("keepalive"); return(0); }
+               if (i < 0) { closesocket(s); perror("keepalive"); return(0); }
                }
 #endif