--- s3_clnt.c.orig	2016-03-02 17:43:33.256342358 -0800
+++ s3_clnt.c	2016-03-02 17:44:48.744936571 -0800
@@ -2111,6 +2111,10 @@
     if (ctype_num > SSL3_CT_NUMBER) {
         /* If we exceed static buffer copy all to cert structure */
         s->cert->ctypes = OPENSSL_malloc(ctype_num);
+	if (s->cert->ctypes == NULL) {
+	    SSLerr(SSL_F_SSL3_GET_NEW_SESSION_TICKET, ERR_R_MALLOC_FAILURE);
+	    goto err;
+	}
         memcpy(s->cert->ctypes, p, ctype_num);
         s->cert->ctype_num = (size_t)ctype_num;
         ctype_num = SSL3_CT_NUMBER;
