Skip to content

Commit fb726b7

Browse files
committed
Fix from review
1 parent 6aa9db4 commit fb726b7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/internal.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9965,7 +9965,11 @@ void DtlsMsgStore(WOLFSSL* ssl, word16 epoch, word32 seq, const byte* data,
99659965
DtlsMsg* cur = DtlsMsgFind(head, epoch, seq);
99669966
if (cur == NULL) {
99679967
cur = DtlsMsgNew(dataSz, 0, heap);
9968-
if (cur != NULL) {
9968+
if (cur == NULL) {
9969+
WOLFSSL_MSG("DtlsMsgNew allocation failed");
9970+
ssl->error = MEMORY_E;
9971+
}
9972+
else {
99699973
if (DtlsMsgSet(cur, seq, epoch, data, type,
99709974
fragOffset, fragSz, heap, dataSz, encrypted) < 0) {
99719975
DtlsMsgDelete(cur, heap);
@@ -9986,6 +9990,7 @@ void DtlsMsgStore(WOLFSSL* ssl, word16 epoch, word32 seq, const byte* data,
99869990
head = DtlsMsgNew(dataSz, 0, heap);
99879991
if (head == NULL) {
99889992
WOLFSSL_MSG("DtlsMsgNew allocation failed");
9993+
ssl->error = MEMORY_E;
99899994
}
99909995
else if (DtlsMsgSet(head, seq, epoch, data, type, fragOffset,
99919996
fragSz, heap, dataSz, encrypted) < 0) {

0 commit comments

Comments
 (0)