Check return of DtlsMsgCreateFragBucket()

This commit is contained in:
Juliusz Sosinowicz
2022-09-16 12:13:12 +02:00
parent 4b3f6ada8a
commit 9ef10b5435

View File

@ -8427,8 +8427,13 @@ int DtlsMsgSet(DtlsMsg* msg, word32 seq, word16 epoch, const byte* data, byte ty
if (msg->fragBucketList == NULL) { if (msg->fragBucketList == NULL) {
/* Clean list. Create first fragment. */ /* Clean list. Create first fragment. */
msg->fragBucketList = DtlsMsgCreateFragBucket(fragOffset, data, fragSz, heap); msg->fragBucketList = DtlsMsgCreateFragBucket(fragOffset, data, fragSz, heap);
msg->bytesReceived = fragSz; if (msg->fragBucketList != NULL) {
msg->fragBucketListCount++; msg->bytesReceived = fragSz;
msg->fragBucketListCount++;
}
else {
return MEMORY_ERROR;
}
} }
else { else {
/* See if we can expand any existing bucket to fit this new data into */ /* See if we can expand any existing bucket to fit this new data into */