summaryrefslogtreecommitdiff
path: root/demos/guide/tls-client-block.c
diff options
context:
space:
mode:
Diffstat (limited to 'demos/guide/tls-client-block.c')
-rw-r--r--demos/guide/tls-client-block.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/demos/guide/tls-client-block.c b/demos/guide/tls-client-block.c
index b2d2a89dd1..75ce7ebcc2 100644
--- a/demos/guide/tls-client-block.c
+++ b/demos/guide/tls-client-block.c
@@ -76,8 +76,10 @@ static BIO *create_socket_bio(const char *hostname, const char *port)
/* Create a BIO to wrap the socket*/
bio = BIO_new(BIO_s_socket());
- if (bio == NULL)
+ if (bio == NULL) {
BIO_closesocket(sock);
+ return NULL;
+ }
/*
* Associate the newly created BIO with the underlying socket. By