summaryrefslogtreecommitdiff
path: root/app/openssl/apps/s_socket.c
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2014-09-23 18:10:57 +0200
committerParménides GV <parmegv@sdf.org>2014-09-23 18:10:57 +0200
commitd0e7ba3029b2fd42582413aa95773fe7dbdede90 (patch)
tree733b8601d6e3a070fc54bde280526e16d0c69507 /app/openssl/apps/s_socket.c
parent248ce016ac2f33df9673e90277733abfd854f27d (diff)
Updated native subprojects from ics-openvpn.
Diffstat (limited to 'app/openssl/apps/s_socket.c')
-rw-r--r--app/openssl/apps/s_socket.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/openssl/apps/s_socket.c b/app/openssl/apps/s_socket.c
index 380efdb1..94eb40f3 100644
--- a/app/openssl/apps/s_socket.c
+++ b/app/openssl/apps/s_socket.c
@@ -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
@@ -450,6 +450,7 @@ redoit:
if ((*host=(char *)OPENSSL_malloc(strlen(h1->h_name)+1)) == NULL)
{
perror("OPENSSL_malloc");
+ closesocket(ret);
return(0);
}
BUF_strlcpy(*host,h1->h_name,strlen(h1->h_name)+1);
@@ -458,11 +459,13 @@ redoit:
if (h2 == NULL)
{
BIO_printf(bio_err,"gethostbyname failure\n");
+ closesocket(ret);
return(0);
}
if (h2->h_addrtype != AF_INET)
{
BIO_printf(bio_err,"gethostbyname addr is not AF_INET\n");
+ closesocket(ret);
return(0);
}
}