mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-11 19:30:40 +03:00
fixed memory leak coap_send
This commit is contained in:
1 parent
bdbcf29bd1
commit
9d9b941c40
1 file changed
+2
@@ -1747,10 +1747,12 @@ coap_send_internal(coap_session_t *session, coap_pdu_t *pdu) {
|
||||
|
||||
if (pdu->used_size + 1 > pdu->max_size) {
|
||||
/* No space */
|
||||
coap_delete_pdu(pdu);
|
||||
return (coap_mid_t)COAP_DROPPED_RESPONSE;
|
||||
}
|
||||
if (!coap_pdu_resize(pdu, pdu->used_size + 1)) {
|
||||
/* Internal error */
|
||||
coap_delete_pdu(pdu);
|
||||
return (coap_mid_t)COAP_DROPPED_RESPONSE;
|
||||
}
|
||||
data_len = pdu->used_size - (pdu->data - pdu->token);
|
||||
|
||||
Reference in new issue
Block a user