fixed memory leak coap_send

This commit is contained in:
Patryk Jarosz authored and Jon Shallow committed 2025-10-22 15:35:56 +01:00
1 parent e13dfda905
commit 10a7e3c82d
1 file changed
+2
+2
View File
@@ -1920,10 +1920,12 @@ coap_send_internal(coap_session_t *session, coap_pdu_t *pdu, coap_pdu_t *request
if (pdu->used_size + 1 > pdu->max_size) {
/* No space */
coap_delete_pdu_lkd(pdu);
return (coap_mid_t)COAP_DROPPED_RESPONSE;
}
if (!coap_pdu_resize(pdu, pdu->used_size + 1)) {
/* Internal error */
coap_delete_pdu_lkd(pdu);
return (coap_mid_t)COAP_DROPPED_RESPONSE;
}
data_len = pdu->used_size - (pdu->data - pdu->token);