diff options
author | Parménides GV <parmegv@sdf.org> | 2014-10-02 18:19:30 +0200 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2014-10-02 18:19:30 +0200 |
commit | 34643c6b5ab0643383e24025876b0d69859ba4f9 (patch) | |
tree | cb15666fb01b0f0410327ae7aaa23df444ac3b4c /app/openssl/apps/s_socket.c | |
parent | 22b7ee4614a2f47d55496de8a9b55040c0f4ba85 (diff) | |
parent | 914c5156b014970dde717b9a27c0c69f11cc7d98 (diff) |
Merge branch 'feature/Update-ndk-version-and-native-binaries-#6142' into develop
Diffstat (limited to 'app/openssl/apps/s_socket.c')
-rw-r--r-- | app/openssl/apps/s_socket.c | 5 |
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); } } |