Hi All,
>From OpenSSL RT #3342:
CID: 966576 & 96677
Index: lib/libssl/src/apps/s_socket.c
===================================================================
RCS file: /cvs/src/lib/libssl/src/apps/s_socket.c,v
retrieving revision 1.38
diff -u -p -u -p -r1.38 s_socket.c
--- lib/libssl/src/apps/s_socket.c 23 May 2014 16:16:55 -0000 1.38
+++ lib/libssl/src/apps/s_socket.c 25 May 2014 07:25:03 -0000
@@ -122,6 +122,7 @@ init_client(int *sock, char *host, char
(char *) &i, sizeof(i));
if (i < 0) {
perror("keepalive");
+ close(s);
return (0);
}
}
@@ -281,16 +282,19 @@ redoit:
} else {
if ((*host = strdup(h1->h_name)) == NULL) {
perror("strdup");
+ close(ret);
return (0);
}
h2 = gethostbyname(*host);
if (h2 == NULL) {
BIO_printf(bio_err, "gethostbyname failure\n");
+ close(ret);
return (0);
}
if (h2->h_addrtype != AF_INET) {
BIO_printf(bio_err, "gethostbyname addr is not
AF_INET\n");
+ close(ret);
return (0);
}
}