SSL_CTX_new() may fail with return value NULL.

Signed-off-by: Kazuki Yamaguchi <k...@rhe.jp>
---
 imap-send.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/imap-send.c b/imap-send.c
index 0364b326e109..c5e24a35491d 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -298,6 +298,10 @@ static int ssl_socket_connect(struct imap_socket *sock, 
int use_tls_only, int ve
        }
 
        ctx = SSL_CTX_new(meth);
+       if (!ctx) {
+               ssl_socket_perror("SSL_CTX_new");
+               return -1;
+       }
 
        if (verify)
                SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL);
-- 
2.8.1.104.g0d1aca6

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to