diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 4133c43ff2b5ec59a1a56687527fe110e6cefa34..8d5fd12903c2b83c151c88f2ad88e105742bcf41 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -4094,6 +4094,11 @@ tls1_heartbeat(SSL *s) * - Padding */ buf = OPENSSL_malloc(1 + 2 + payload + padding); + if (buf == NULL) + { + SSLerr(SSL_F_TLS1_HEARTBEAT,ERR_R_MALLOC_FAILURE); + return -1; + } p = buf; /* Message Type */ *p++ = TLS1_HB_REQUEST;