diff --git a/include/coap3/lwippools.h b/include/coap3/lwippools.h index 445bce4a..d3f39d04 100644 --- a/include/coap3/lwippools.h +++ b/include/coap3/lwippools.h @@ -66,7 +66,7 @@ #endif #ifndef MEMP_LEN_COAPSTRING -#define MEMP_LEN_COAPSTRING 32 +#define MEMP_LEN_COAPSTRING 40 #endif #ifndef MEMP_NUM_COAPCACHE_KEYS diff --git a/src/coap_io_lwip.c b/src/coap_io_lwip.c index 26179caf..5226d662 100644 --- a/src/coap_io_lwip.c +++ b/src/coap_io_lwip.c @@ -110,7 +110,8 @@ error: * https://tools.ietf.org/html/rfc7252#section-4.2 MUST send RST * https://tools.ietf.org/html/rfc7252#section-4.3 MAY send RST */ - coap_send_rst(session, pdu); + if (session) + coap_send_rst(session, pdu); coap_delete_pdu(pdu); if (packet) { packet->pbuf = NULL;