From 1d4c7b4858f467289b3bf5592b772a9526abe0c3 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sun, 16 Nov 2014 01:45:00 +0100 Subject: Check for error allocating tls struct --- vchat-protocol.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vchat-protocol.c b/vchat-protocol.c index 6532fbb..88631ef 100755 --- a/vchat-protocol.c +++ b/vchat-protocol.c @@ -128,7 +128,12 @@ vcconnect (char *server, char *port) /* If SSL is requested, get our ssl-BIO running */ if( server_conn && getintoption(CF_USESSL) ) { vc_store = vc_init_x509store(); - // XXX TODO: Check error (with new API) + if( !vc_store ) { + snprintf (tmpstr, TMPSTRSIZE, getformatstr(FS_ERR), "Out of memory" ); + writechan (tmpstr); + return -1; + } + vc_x509store_setflags(vc_store, VC_X509S_SSL_VERIFY_PEER); /* get name of certificate file */ -- cgit v1.2.3