diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2016-04-09 01:22:14 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-04-08 11:46:22 -0700 |
commit | 6738a33b3102222b25f7a1596aa1ed39c478a268 (patch) | |
tree | 9e934e9e819cdc9c297f7f6a1d4beefaa33c1dae /imap-send.c | |
parent | 1ed2c7b11570f5d16bdc70d151fa78c3dccf6d38 (diff) | |
download | git-6738a33b3102222b25f7a1596aa1ed39c478a268.tar.gz |
imap-send: check NULL return of SSL_CTX_new()
SSL_CTX_new() may fail with return value NULL.
Signed-off-by: Kazuki Yamaguchi <k@rhe.jp>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'imap-send.c')
-rw-r--r-- | imap-send.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/imap-send.c b/imap-send.c index 8bf363bbdf..e964e2a7fc 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); |