summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/s_socket.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/s_socket.c b/apps/s_socket.c
index 465321754c..6d77d8215b 100644
--- a/apps/s_socket.c
+++ b/apps/s_socket.c
@@ -195,6 +195,8 @@ int init_client(int *sock, const char *host, const char *port,
if (*sock == INVALID_SOCKET) {
ERR_print_errors(bio_err);
} else {
+ /* Remove any stale errors from previous connection attempts */
+ ERR_clear_error();
ret = 1;
}
BIO_ADDRINFO_free(res);