Fix null pointer errors.

PR#3394

(Imported from upstream's cea5a1d5f255a6a186cd7944c4a312612da965f3)
diff --git a/ssl/d1_both.c b/ssl/d1_both.c
index 85ea130..9420e92 100644
--- a/ssl/d1_both.c
+++ b/ssl/d1_both.c
@@ -1054,6 +1054,8 @@
 	assert(s->init_off == 0);
 
 	frag = dtls1_hm_fragment_new(s->init_num, 0);
+	if (!frag)
+		return 0;
 
 	memcpy(frag->fragment, s->init_buf->data, s->init_num);