diff --git a/net.c b/net.c index c0b06fd9..3d20422a 100644 --- a/net.c +++ b/net.c @@ -870,7 +870,7 @@ handle_request(coap_context_t *context, coap_queue_t *node) { opt_filter); } - if (coap_send(context, &node->remote, response) == COAP_INVALID_TID) { + if (response && coap_send(context, &node->remote, response) == COAP_INVALID_TID) { warn("cannot send response for transaction %u\n", node->id); coap_delete_pdu(response); } diff --git a/pdu.c b/pdu.c index bcc511d6..0636a4bf 100644 --- a/pdu.c +++ b/pdu.c @@ -27,7 +27,7 @@ #ifdef WITH_CONTIKI #include "memb.h" -typedef unsigned char _pdu[COAP_MAX_PDU_SIZE]; +typedef unsigned char _pdu[sizeof(coap_pdu_t) + COAP_MAX_PDU_SIZE]; MEMB(pdu_storage, _pdu, COAP_PDU_MAXCNT);