From fb726b70c7e25fdf5f7944a2b80deddb374932a8 Mon Sep 17 00:00:00 2001 From: Eric Blankenhorn Date: Tue, 14 Apr 2026 16:44:16 -0500 Subject: [PATCH] Fix from review --- src/internal.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/internal.c b/src/internal.c index acff31659e..92181d2bcf 100644 --- a/src/internal.c +++ b/src/internal.c @@ -9965,7 +9965,11 @@ void DtlsMsgStore(WOLFSSL* ssl, word16 epoch, word32 seq, const byte* data, DtlsMsg* cur = DtlsMsgFind(head, epoch, seq); if (cur == NULL) { cur = DtlsMsgNew(dataSz, 0, heap); - if (cur != NULL) { + if (cur == NULL) { + WOLFSSL_MSG("DtlsMsgNew allocation failed"); + ssl->error = MEMORY_E; + } + else { if (DtlsMsgSet(cur, seq, epoch, data, type, fragOffset, fragSz, heap, dataSz, encrypted) < 0) { DtlsMsgDelete(cur, heap); @@ -9986,6 +9990,7 @@ void DtlsMsgStore(WOLFSSL* ssl, word16 epoch, word32 seq, const byte* data, head = DtlsMsgNew(dataSz, 0, heap); if (head == NULL) { WOLFSSL_MSG("DtlsMsgNew allocation failed"); + ssl->error = MEMORY_E; } else if (DtlsMsgSet(head, seq, epoch, data, type, fragOffset, fragSz, heap, dataSz, encrypted) < 0) {