tls1_heartbeat: check for NULL after allocating buf